I have Person aggregate, which is root aggregate
public class Person
{
private int id;
private readonly PersonID personID;
private readonly string email;
private readonly string firstName;
private readonly string lastName;
private readonly string username;
private readonly string password;
private readonly Address BillingAddress;
}
public class Currency : IValueObject<Currency>
{
private string name;
private string currencyCode;
private decimal rate;
private string displayLocale;
private string customFormatting;
private int displayOrder;
private bool primaryExchangeRateCurrency;
private bool primaryStoreCurrency;
//<summary>
//Gets or a value indicating whether the currency is primary exchange rate currency
//</summary>
public bool IsPrimaryExchangeRateCurrency
{
get
{
return primaryExchangeRateCurrency;
}
}
/// <summary>
/// Gets or a value indicating whether the currency is primary store currency
/// </summary>
public bool IsPrimaryStoreCurrency
{
get
{
return primaryStoreCurrency;
}
}
}
and Currency class, which is to be referenced in Person class.
So now if a Person entity is created , we need to associate it a currency too.But among all Currencies created, i want to know which is the default primary store currency. I don't want to know it through Person because it contains only single currency. I want to get a currency which is PrimaryStoreCurrency from all created currencies of persons.
I want to bind currency in drop down so that user can select its currency from dropdown and register in our system.
So, do i create Currency as seperate aggregate ?