货币是否是价值对象
|
我有个人汇总,这是根汇总
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;
}
}
}
和“货币”类,该类将在“人”类中引用。
因此,现在如果创建了Person实体,我们也需要将其与一种货币相关联,但是在创建的所有货币中,我想知道哪种是默认的主要商店货币。我不想通过Person来了解它,因为它仅包含一种货币。我想从人的所有已创建货币中获取一个货币PrimaryStoreCurrency。
我想在下拉列表中绑定货币,以便用户可以从下拉列表中选择其货币并在我们的系统中注册。
那么,我是否将Currency创建为单独的汇总?
没有找到相关结果
已邀请:
2 个回复
寒健
驮帽俺篮号