0

ラムダ式に変換したい次の SQL があります。

SELECT DISTINCT Make FROM
(
   SELECT DISTINCT [Option] AS Make FROM [dbo].[ItemCategoryDetailOptions]
   WHERE [IsHidden] = 0 AND [Retired] is null
   UNION
   SELECT DISTINCT [Brand] AS Make FROM [dbo].[Items] WHERE [Brand] is not null
) AS result
WHERE Make LIKE '%LG%'
4

2 に答える 2

0
var result = ItemCategoryDetailOptions
    .Where(i => !i.IsHidden && i.Retired != null)
    .Select(i => i.Option)
    .Distinct()
    .Union(Items
      .Where(i => i.Brand != null)
      .Select(i => i.Brand)
      .Distinct()))
    .Where(i => i.Contains("LG"));
于 2013-09-11T10:04:38.530 に答える