var largeset =
from inv in context.Invoices
join line in context.InvoiceLines on inv.InvoiceId equals line.InvoiceId
into Lines from linejoin in Lines
join track in context.Tracks on linejoin.TrackId equals track.TrackId
into Tracks
select new
{
Invoice = inv,
Line = Lines,
Track = Tracks
};
// Filter by search term
if (!string.IsNullOrEmpty(SearchTerm))
{
largeset = largeset.Where(x =>
x.Invoice.Customer.LastName.StartsWith(SearchTerm) ||
x.Invoice.Customer.FirstName.StartsWith(SearchTerm) ||
x.Track.Where(t => t.Name.Contains(SearchTerm)).Count > 0);
}
此代码段的最后一行
x.Track.Where(t => t.Name.Contains(SearchTerm)).Count > 0
导致错误
错误CS0019运营商'>'不能应用于类型的操作数 '方法组'和'int'
提前致谢。
答案 0 :(得分:4)
https://msdn.microsoft.com/en-us/library/bb338038(v=vs.100).aspx
您需要使用VK_FORMAT_B8G8R8A8_UNORM
调用方法Count
,而不是仅仅引用成员名称,就好像它是属性一样。