我有一项任务,我需要升级旧系统,其中存储过程完成eveything。所以我一直试图将这个程序转换一段时间,但我不能让我做对。
ALTER PROCEDURE [dbo].[p_GetFeaturesForAllLanguages]
@id nvarchar(50),
@company nvarchar(50)
AS
BEGIN
SELECT
DISTINCT LanguageParameters.Company, LanguageParameters.languageId, LanguageParameters.locale,
LanguageParameters.ResourcePath, ExtractedFeatures.id, ExtractedFeatures.language,
ExtractedFeatures.title
FROM
[LanguageParameters] LEFT OUTER JOIN ExtractedFeatures ON [LanguageParameters].company = extractedfeatures.company
and ([LanguageParameters].languageid = extractedfeatures.language) AND ExtractedFeatures.id = @id
WHERE
[LanguageParameters].company = @company
END
请帮我转换为lambda表达式!
编辑:
我从过程转换的搜索方法示例。
using (var ctx = new PamEntities())
{
var features =
ctx.ExtractedFeatures.Where(w => w.Company == companyName && w.title.Contains(search)).ToList();
return Task.FromResult(features as IList<ExtractedFeatures>);
}