问题
I have a list of posts that i get from DB like that:
var iQueryablePost= from p in context.Posts
select new Post
{
Id=p.id,
Label=p.label
};
var posts = new List<Post>();
posts = await iQueryablePost.ToListAsync();
I wanna filter my posts after getting all from DB, if i add where to my iQueryable it works just fine but i need to get all post from DB.
That's what i did and the message I see in QuickWatch :
posts = !string.IsNullOrWhiteSpace(query.PdcIdSITiers) ?
posts.Where(c => c.Label.ToLower().Contains(query.label.ToLower())).ToList() :
posts;
QuickWatch message:
Evaluation of method System.Linq.Enumerable.ToList() calls into native method Interop+Kernel32.FindStringOrdinal(). Evaluation of native methods in this context is not supported. System.Collections.Generic.List
The project is based in a CQRS design-pattern
回答1:
The probleme comes from a Label that is Null After deleting this row from my list the code work just fine.
Thanks for all your comments
来源:https://stackoverflow.com/questions/54197842/evaluation-of-method-system-linq-enumerable-tolist-calls-into-native-method-in