我需要扩展我的领域模型:产品可能有不同的规格。例如,主板规格与显示器规格不同。
有两个实体:
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
。