public UserMaster Login(UserMaster userMaster, string otp)
{
return (from um in _context.UserMasters.Where(u => u.UserName == userMaster.UserName && u.Password == userMaster.Password && u.IsDisplay == true && u.IsActive == true)
join pin in _context.UserPins.Where(p => p.Pin == otp) on um.UserId equals pin.UserId
select new { um }).SingleOrDefault();
}
如果条件满足,我试图返回User的对象,即如果用户具有正确的pass和username以及来自不同表的正确otp。我只需要/要求返回用户主对象。
给出以下错误
答案 0 :(得分:0)
public UserMaster Login(UserMaster userMaster, string otp)
{
return (from um in _context.UserMasters.Where(u => u.UserName == userMaster.UserName && u.Password == userMaster.Password && u.IsDisplay == true && u.IsActive == true)
join pin in _context.UserPins.Where(p => p.Pin == otp) on um.UserId equals pin.UserId
select um).FirstOrDefault();
}