System.Collections.Generic.IEnumerable

use*_*182 1 linq linq-to-entities frameworks linq-to-sql entity-framework-4

当试图用entityframework查询我的数据库时,我得到以下错误:类型'System.Collections.Generic.IEnumerable 1[[TASK.Warehouses.Domain.NoteProducts.NoteProduct, TASK.Warehouses.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is not a single implementation of 'System.Collections.Generic.ICollection1 [T]' 的导航属性.可能是什么问题,我怎么能解决它

SLa*_*aks 5

您编写了具有IEnumerable<T>导航属性的Code-First类.

实体框架要求您的导航属性是类型ICollection<T>.