我需要帮助将 SQL 语句转换为 C# LINQ
I need help to Convert a SQL Statement to C# LINQ
我需要帮助在 LINQ C#
代码
中转换此 Select 语句
SELECT TagName
from Tags
Where TagId IN(
SELECT TagId
from PresentationTags
Where PresentationId = 2
)
Where()
嵌套 Any()
应该可以完成工作
context.Tags.Where(
x => context.PresentationTags.Any(
y => y.PresentationId == 2 && x.TagId == y.TagId
)
).Select(x => x.TagName);
我需要帮助在 LINQ C#
代码
SELECT TagName
from Tags
Where TagId IN(
SELECT TagId
from PresentationTags
Where PresentationId = 2
)
Where()
嵌套 Any()
应该可以完成工作
context.Tags.Where(
x => context.PresentationTags.Any(
y => y.PresentationId == 2 && x.TagId == y.TagId
)
).Select(x => x.TagName);