How do I load related entities of type IEnumerable

后端 未结 2 1614
猫巷女王i
猫巷女王i 2020-12-21 04:09

I\'m trying to load related entities of a SingleOrDefault entity, but I am getting the following exception:

The navigation property of type IEnumerable is not a sing

2条回答
  •  醉酒成梦
    2020-12-21 04:41

    IEnumerable is not supported as a type for a navigation collection. You must use ICollection or another interface derived from it (for example IList) or a concrete implementation of ICollection - like List, HashSet, etc.

提交回复
热议问题