评估方法 System.Linq.Enumerable.ToList() 调用 QuickWatch 中的本机方法 Interop+Kernel32.FindStringOrdinal()
Evaluation of method System.Linq.Enumerable.ToList() calls into native method Interop+Kernel32.FindStringOrdinal() in QuickWatch
我有一个 post 的列表,我从数据库中得到这样的列表:
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();
我想在从 DB 获取所有内容后过滤我的 posts,如果我将 where 添加到我的 iQueryable 它工作得很好,但我需要获取所有 post 来自数据库。
这就是我所做的以及我在 QuickWatch 中看到的消息:
posts = !string.IsNullOrWhiteSpace(query.PdcIdSITiers) ?
posts.Where(c => c.Label.ToLower().Contains(query.label.ToLower())).ToList() :
posts;
速看消息:
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
该项目基于 CQRS 设计模式
问题来自 Label 即 Null
从我的列表中删除这一行后,代码工作正常。
感谢您的所有评论
我有一个 post 的列表,我从数据库中得到这样的列表:
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();
我想在从 DB 获取所有内容后过滤我的 posts,如果我将 where 添加到我的 iQueryable 它工作得很好,但我需要获取所有 post 来自数据库。
这就是我所做的以及我在 QuickWatch 中看到的消息:
posts = !string.IsNullOrWhiteSpace(query.PdcIdSITiers) ?
posts.Where(c => c.Label.ToLower().Contains(query.label.ToLower())).ToList() :
posts;
速看消息:
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
该项目基于 CQRS 设计模式
问题来自 Label 即 Null 从我的列表中删除这一行后,代码工作正常。
感谢您的所有评论