【发布时间】:2014-12-24 07:41:35
【问题描述】:
现在我的数据库具有以下(简化)格式:
ShoppingList
{
List<ListProduct> listProducts
}
ListProduct
{
int quantity
Product product
}
Product
{
information about the overall product...
List<StoreProduct> StoreProduct
}
StoreProduct
{
information about the specific product and the store
}
一般来说,shoppinglist 包含一个 listproducts 列表,每个列表都包含他们的数量和他们的 product,每个列表都包含 >商店产品。
这一切都很好 - 但是,在我的购物清单中,我想跟踪购买了哪些商店产品。现在我不能只在我的 storeproducts 中添加一个“purchased”布尔值,因为它们用于多个购物清单(静态信息)。
我想添加 ListProduct 的 purchaseProduct 属性,该属性将设置为购买的 storeProduct,否则为 null。
但是我不确定是否存在更好的解决方案?我的架构已经很复杂,所以如果没有必要,我不想让它变得更复杂。
更新: 这是我的客户表:
Customer
{
List<ShoppingList> shoppingLists
}
【问题讨论】:
标签: database entity-framework database-design relational-database