我想使用 linq 从数据库获取查询,但每次都返回 null 或空;
var user = await _identityDb.Users.FirstOrDefaultAsync(u => u.UserName == user.UserName); // this return null but user exist even in debuger var users = _identityDb.Users.Where(u => u.UserName == user.UserName); // this return empty
update
这返回用户
var users = _identityDb.Users.Where(u => u.UserName == u.UserName.ToString());
但这返回空
var users = _identityDb.Users.Where(u => u.UserName == user.UserName.ToString());
紫衣仙女
慕田峪4524236
饮歌长啸
相关分类