public async Task <UserDto> CreateAsync(UserDto user) { var dataModel = user.Convert(); await this.repo.Users.AddAsync(dataModel); await this.repo.SaveChangesAsync(); return(dataModel.Convert()); }
public UserDto GetUser(int id) { IUser user = this._userRepository.GetUser(id); if (user != null) { UserDto u = UserDto.Convert(user); u.Credential = user.GetCredential(); u.Roles = user.GetAppRole(); return(u); } return(null); }