Example #1
0
 /// <summary>
 /// Инициализация по имени
 /// </summary>
 /// <param name="email">имя пользователя [email]</param>
 public void Init(string email, IRepository repository)
 {
     if (!string.IsNullOrEmpty(email))
     {
         User = repository.GetUser(email);
     }
 }
Example #2
0
        public User Create(string name, string email, string password)
        {
            var user = new User(email, name, password);

            var result = Db.SaveOrUpdate(user);
            return user;
        }
Example #3
0
        public User Update(UserDto dto)
        {
            var item = new User();
            item = Db.Get<User>(dto.Id);
            item = Mapper.Map(dto, item);

            if(!string.IsNullOrEmpty(dto.Password))
            {
                item.ChangePassword(dto.Password);
            }

            var result = Db.SaveOrUpdate(item);

            return item;
        }