【发布时间】:2010-07-16 05:27:09
【问题描述】:
I have a few filters on my view, the first one is list by first name, last name and company name when one of these options are selected the user can then select a, b, c ... x, y, z 仅显示以所选字母开头的人。
if (collection["Filter"] == "2") {
presentations = presentations.Where(x => x.Person.FirstName.StartsWith("A"));
presentations = presentations.OrderBy(x => x.Person.FirstName);
}
返回的结果类似于
John Squirel
Basil Boywiz
David Smith
这似乎不起作用,我错过了什么?
我进一步挖掘,这是导致问题的查询。
SELECT [t0].[Description], [t0].[EventId], [t0].[Id], [t0].[PresentedOn],
[t0].[Slug], [t0].[SpeakerId], [t0].[Title], [t0].[Url]
FROM [Presentations] AS t0
LEFT OUTER JOIN [Speakers] AS t1 ON ([t1].[Id] = [t0].[Id])
WHERE ([t1].[FirstName] LIKE 'B' + '%')
ORDER BY [t1].[FirstName]
【问题讨论】:
标签: c# linq asp.net-mvc-2