示例#1
0
文件: User.cs 项目: valeriob/MyBudget
 public UserCreated(Guid id, DateTime timestamp, UserId userId, UserLoginInfo loginInfo, string userName, string password)
 {
     Id = id;
     Timestamp = timestamp;
     UserId = userId;
     LoginInfo = loginInfo;
     UserName = userName;
     Password = password;
 }
 public async Task<ApplicationUser> FindAsync(UserLoginInfo userLoginInfo)
 {
     return _users.Values.SingleOrDefault(d => d.CanLoginWith(userLoginInfo));
 }
 internal bool CanLoginWith(UserLoginInfo info)
 {
     return _logins.Contains(info);
 }
示例#4
0
 public void Apply(UserCreated evnt)
 {
     Id = evnt.UserId.ToString();
     UserName = evnt.UserName;
     Created = evnt.Timestamp;
     LoginInfo = evnt.LoginInfo;
 }
示例#5
0
文件: User.cs 项目: valeriob/MyBudget
 public UserLoginAdded(Guid id, DateTime timestamp, UserId userId, UserLoginInfo loginInfo)
 {
     Id = id;
     Timestamp = timestamp;
     UserId = userId;
     LoginInfo = loginInfo;
 }
示例#6
0
文件: User.cs 项目: valeriob/MyBudget
 public void Apply(UserCreated evnt)
 {
     Id = evnt.UserId.ToString();
     _loginInfo = evnt.LoginInfo;
 }
示例#7
0
文件: User.cs 项目: valeriob/MyBudget
        internal void RemoveLogin(UserLoginInfo loginInfo)
        {
            if (string.IsNullOrEmpty(Id))
                throw new Exception("User does not exists");

            RaiseEvent(new UserLoginRemoved(Guid.NewGuid(), DateTime.Now, new UserId(Id), loginInfo));
        }
示例#8
0
文件: User.cs 项目: valeriob/MyBudget
        public void Create(UserId userId, UserLoginInfo loginInfo, string userName, string password)
        {
            if (string.IsNullOrEmpty(Id) == false)
                throw new Exception("User already exists");

            RaiseEvent(new UserCreated(Guid.NewGuid(), DateTime.Now, userId, loginInfo, userName, password));
        }