2
我想對TableType應用條件。Linq使用案例
If t.TableName='limit' then TabeType should be A_TypeTable
If t.TableName='health' then TabeType should be B_TypePolicy
If t.TableName='waiting' then TabeType should be C_TypeTable
以下是查詢。我不確定在哪裏分配案件陳述。
var query = from a in tableA
join b in tableB on a.Hid equals b.Hid into ab
select new
{
TableType= ab.Select(t=>t.TableName).FirstOrDefault(),
UserName = a.UserName,
Description = a.Description,
ImportedDate = a.ImportedDate
};
任何意見,將不勝感激。 在此先感謝