[英]Is it possible to have Entity Framework use List<T> instead of ICollection<T> when generating classes from the DB?
标题很容易说明。 我想让我的EF自动生成的部分类使用ICollection的List intead。
是的。 我已经做了很多次了。 您在生成它时遇到一些问题吗?
例如: public virtual List<Property> Properties { get; set; }
public virtual List<Property> Properties { get; set; }
否,因为当您点击.ToList()会返回列表EF时,它将与查询一起访问数据库,因此始终最好在末尾计算.ToList
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.