I tried to cast it directly like this
And get error: Cannot implicitly convert type
'System.Linq.IQueryable' to 'System.Collections.Generic.List<TEntity>'
Then I found that it has method to convert to list or cast
to object and it can be either casted to
TEntity by calling cast<object> or converted to List<TEntety>
By calling .ToList(List<TEntety>)
For example here us property :
public List<TEntety> test
{
get
{
Return (from tentety
in db.TEntety
select tentety).ToList<TEntety>();
}
}
Currently rated 3.5 by 4 people
- Currently 3.5/5 Stars.
- 1
- 2
- 3
- 4
- 5