from子句中的表达式类型不正确。键入推论失败,在调用中选择了很多

时间:2018-10-09 10:23:24

标签: c#-4.0 linq-to-entities

我正在将项目从VB.NET转换为C#.NET,但是某些地方的语法在VB中是正确的,但在C#中不起作用,并抛出一些错误。

response = (from setng in entities.Settings
                    join DF in entities.DownloadFileSortTables on setng.SystemSettID equals Convert.ToInt32(DF.FileId) into Dyne
                    from Fitem in Dyne.DefaultIfEmpty
                    where setng.SystemSettID = userSettingID
                    select new DynamicDownloadSortFileViewModel { Id = setng.SystemSettID, FileName = Fitem.FileName, FIleURL = Fitem.FIleURL,
                        PageName = Fitem.PageName, ListName = Fitem.ListName, ListId = Fitem.ListId }).FirstOrDefault();

FitemDyne.DefauldIfEmpty之前的关键字“ from”在标题中引发错误。

0 个答案:

没有答案