如何在仅代码场景中声明多对多关系 [英] How to declare many to many relationship in code only scenario

查看:86
本文介绍了如何在仅代码场景中声明多对多关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在仅代码场景中声明多对多关系?

How to declare many to many relationship in code only scenario?

推荐答案

我在上一篇关于代码的文章中找到了如何做到这一点。主要问题是将我的集合从IList更改为ICollection。一切都开始工作了。

为什么使用ICollection而不是IList。有技术原因吗? IList是NH的一个好习惯。
I found how to do it in last ef post about code only. The main problem was to change my collections from IList to ICollection. And everything start working.

Also Why are using ICollection instead of IList. Is there any technical reasons? IList was a good practice in NH.


这篇关于如何在仅代码场景中声明多对多关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆