我將 ASP.NET Core 與物體框架一起使用。
我在 Stackoverflow 上找到了這個作業命令
var d = await db.Employee.Where(x => x.FirstName == "Jack").ToListAsync();
在以下鏈接: 物體框架 - 使用 where 條件進行異步選擇
請告訴我如何根據多個 where 條件將表記錄加載到串列中。
我想要這樣的東西:
var d = await db.Employee.Where(x => x.LastName == "Smith"
and x => x.Country == "UK"
and x => x.Age == 45 etc)
uj5u.com熱心網友回復:
你快到了
var d = await db.Employee.Where(x => x.LastName == "Smith"
&& x.Country == "UK"
&& x.Age == 45)
.ToListAsync();
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/313321.html
