【发布时间】:2013-01-05 15:05:16
【问题描述】:
我需要扩展我的领域模型:产品可能有不同的规格。例如。主板规格与显示器规格不同。
有两个实体:
public class Product {
public Guid Id { get; set; }
public Category Category { get; set; }
// ..Price, Title, Manufacturer properties
}
Category 在哪里
public class Category {
// ..ctor to initialize this.Specs as List or as Dictionary
public Guid Id { get; set; }
public String Title { get; set; }
public ICollection<String> Specs { get; set; }
}
这是解决这个问题的正常方法吗?我的意思是将ICollection<String> Specs 放入Category 实体中?
我正在使用ASP.NET MVC 和Raven DB。
【问题讨论】: