修改BUG:MongoDB数据库Users类RetrieveUserByUserName方法缺失默认值设置 #IS2WS
This commit is contained in:
parent
a9d3c78ff2
commit
5ea8022d3c
|
@ -33,8 +33,15 @@ namespace Bootstrap.DataAccess.MongoDB
|
||||||
.Include(u => u.UserName)
|
.Include(u => u.UserName)
|
||||||
.Include(u => u.DisplayName)
|
.Include(u => u.DisplayName)
|
||||||
.Include(u => u.Icon)
|
.Include(u => u.Icon)
|
||||||
.Include(u => u.Css);
|
.Include(u => u.Css)
|
||||||
return DbManager.Users.Find(user => user.UserName.ToLowerInvariant() == userName.ToLowerInvariant()).Project<DataAccess.User>(project).FirstOrDefault();
|
.Include(u => u.App);
|
||||||
|
var ret = DbManager.Users.Find(user => user.UserName.ToLowerInvariant() == userName.ToLowerInvariant()).Project<DataAccess.User>(project).FirstOrDefault();
|
||||||
|
if (ret != null)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(ret.Icon)) ret.Icon = "default.jpg";
|
||||||
|
if (string.IsNullOrEmpty(ret.App)) ret.App = "0";
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue