Using LINQ in ICollection (EF)
-
29-06-2021 - |
Domanda
It happends that in EF you must use ICollection for your properties,
eg. public virtual ICollection<Question> Questions { get; set; }
But I wan't to use LINQ on that list, which is not possible in ICollection.
Should I cast it to IQueryable? How? or what is the standard way to achieve this?
Soluzione
Ryan is correct in the comments.
You need to ensure that you reference the Linq namespace.
using System.Linq;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow