public UserDtoOutput Create(UserDtoInput user) { try { using var contextTran = db.Database.BeginTransaction(); User usermodel = new User() { UserName = "******", FirstName = user.FirstName, LastName = user.LastName, PasswordHash = user.Password, Email = user.Email }; User result = UserRepository.Create(usermodel); UserDtoOutput output = new UserDtoOutput() { UserName = result.UserName, FirstName = result.FirstName, LastName = result.LastName, Email = result.Email, Password = result.PasswordHash }; return(output); } catch (Exception) { throw; } }
public ActionResult <UserDtoOutput> FindByUserName(string UserName) { UserModel user = _userService.FindUserByUsername(UserName); UserDtoOutput userDto = _mapper.Map <UserModel, UserDtoOutput>(user); return(Ok(userDto)); }
public AuthOutput(UserDtoOutput user, string token) { User = user; Token = token; }