1

我有以下代码:

if (collection["Filter"] == "2") { 
   presentations = presentations.Where(x => x.Speaker.FirstName.StartsWith("B")).
   OrderBy(x => x.Speaker.FirstName);
}

这会生成以下 sql:

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]

问题是连接应该是:

LEFT OUTER JOIN [Speakers] AS t1 ON ([t1].[Id] = [t0].[SpeakerId])

任何想法如何解决这个问题?使用 StartsWith链接到ASP.NET MVC2 Linq Where 子句

4

1 回答 1

-1

我不认为 SubSonic Linq 提供商非常“成熟”。

于 2010-07-16T12:03:50.737 回答