用户配置文件具有系统上的配置文件属性。 属性可以是不同的类型(AboutYou,Occupation,AnyhingElse)。在实体之间建立适当的关系
现在我想建立适当的关系之间:
- 个人资料和相关属性
- 轮廓属性和配置文件属性类型(我不想使用枚举作为数据类型)
档案。 cs
public List<ProfileAttribute> Attributes {get; set;}
ProfileAttribute.cs
个// holds user entered response on particular subject
// describe yourself (if aboutYou type is selected)
public string Response {get; set;}
public ProfileAttributeType {get; set;}
ProfileAttributeType.cs
public List<ProfileAttribute> Attributes {get; set;}
public string AttributeType {get; set;}
这是遗留代码和数据库,而我试图建立使用DDD方法和产生的数据库表的应用程序,所以我卡在下面。
其中一个Profile
有很多ProfileAttribute
。所以我通过配置文件侧面有one to many
。
我不能通过ProfileAttribute
一边数字关系。是否所有个人档案属于一个档案或是否为many to many
?此响应属性使我困惑。你会怎么做?
而且,ProfileAttribute和ProfileAttributeType我有以下
一个ProfileAttribute
有很多AttributeType
(),通过ProfileAttribute
侧,并通过ProfileAttribute
身边,我有many to one
(很多类型可以属于很多ProfileAttributes)