HuanMengProject/src/0-core/HuanMeng.MiaoYu.Code/Users/UserInfoBLL.cs
2024-07-19 03:20:25 +08:00

43 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HuanMeng.MiaoYu.Code.Users
{
/// <summary>
/// 用户信息
/// </summary>
public class UserInfoBLL : MiaoYuBase<UserInfoBLL>
{
public UserInfoBLL(IServiceProvider serviceProvider) : base(serviceProvider)
{
}
private T_User? _user;
/// <summary>
/// 用户表
/// </summary>
public T_User User
{
get
{
if (_user == null)
{
if (_UserId == 0)
{
throw new Exception("未找到用户");
}
_user = Dao.daoDbMiaoYu.context.T_User.FirstOrDefault(it => it.Id == _UserId);
if (_user == null)
{
throw new Exception("未找到用户");
}
}
return _user;
}
}
}
}