![](/img/trans.png)
[英]Entity Framework 1to1 relationship via association table not working in EDMX
[英]Entity Framework convention for 1to1 relationship
我瀏覽了各種資料,例如,在大多數資料中,我看到了Entity Framework for 1to1關系的約定。
public virtual Product Product {get;set;}
但是我也發現:
public virtual Product Products {get;set;}
使用后一種約定會有特定的原因嗎? 我對下面的Products
有很多了解,但是我對1to1約定特別感興趣。
public virtual ICollection<Product>Products{get;set;}
在您看到的這些示例中,這就是Typo
。
多個名稱通常表示一個集合,即使該集合中只有1個項目也是如此。
使其不為S。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.