FluentNHibernate: What is the effect of AsSet()?

岁酱吖の 提交于 2019-12-04 04:20:44

Assuming your type is an Iesi Set, then there's no difference; the HasMany call on it's own is smart enough to figure out that you want a Set. The AsSet is a way to explicitly change your HasMany to a Set in situations where FNH might not be able to determine it by type, for example if you're exposing your collection as an IEnumerable it would default to a Bag and calling AsSet would override that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!