📜  使用 lambda 从 c# 中的数据表中选择特定列 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:04.633000             🧑  作者: Mango

代码示例1
Object AccountObject = _dbContext.Accounts
                                   .Join(_dbContext.Users, acc => acc.AccountId, usr => usr.AccountId, (acc, usr) => new { acc, usr })
                                   .Where(x => x.usr.EmailAddress == key1)
                                   .Where(x => x.usr.Hash == key2)
                                   .Select(x => new { AccountId = x.acc.AccountId, Name = x.acc.Name })
                                   .SingleOrDefault();