I am using Entity Framework to select entries from a database
List<Entry> entries = dbContext.entries.ToList();
Codeanalysis tells me Warning CA1002: I found out that I should use Collection
instead of List
. But there is no .ToCollection()
Method. Is this warning useless when using EF or what is the best practice there?
Update: When doing
Collection<Entry> entries = dbContext.entries.ToList();
It says something like
type List
<Entry>
can not be cast to Collection<Entry>