我想使用 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());
慕村225694
紫衣仙女
慕田峪4524236
饮歌长啸
随时随地看视频慕课网APP
相关分类