我有一个 LINQ 查询(与 EF 一起使用)
我有以下 LINQ 查询。请指导我如何在此查询中使用 case 或 if 语句。
var selectedResults=
from InvoiceSet in Invoices
join BookedAreasSet in BookedAreas
on InvoiceSet.InvoiceID equals BookedAreasSet.InvoiceID
join AreaSet in Areas on BookedAreasSet.AreaID equals AreaSet.AreaID
select new
{
InvoiceSet.InvoiceNumber,
InvoiceSet.Amount,
InvoiceSet.TotalDiscount,
InvoiceSet.GST,
InvoiceSet.PaymentDate,
InvoiceSet.ShoppingCentreID,
BookedAreasSet.BookedAreaID,
AreaSet.Name //Here I want to use Case/ If statment based on some other column
};
请指导。
谢谢