Пример #1
0
        public IHttpActionResult Register(RegisterModel model)
        {
            // var userDto = Mapper.Map<RegisterModel, UserDto>(model);

             var userDto = new UserDto()
             {
                 Id = model.Id,
                 Login =  model.Login,
                 Password = model.Password,
                 ConfirmPassword = model.ConfirmPassword,
                 Email = model.Email
             };
            var command = new SaveUserCommand() { UserDto = userDto };
            var result = CommandQueryDispatcher.ExecuteCommand(command);
            if (result.Data == null)
            {
                return NotFound();
            }

            return Ok(((UserDto)result.Data).Id);
        }
Пример #2
0
 /// <summary>
 ///Create User
 /// </summary>
 /// <param name="user">User</param>
 /// <returns></returns>
 public string Save(UserDto user)
 {
     return Save<UserDto, UserEntity>(user);
 }