public async Task <UserDto> CreateAsync(UserDto user) { var utcNow = DateTime.UtcNow; var entity = _mapper.Map <User>(user); entity.Created = utcNow; entity.Modified = utcNow; await _context.User.AddAsync(entity); await _context.SaveChangesAsync(true); var userDb = await GetUserAsync(user.Username); return(_mapper.Map <UserDto>(userDb)); }
public async Task CreatePasswordAsync(int userId, byte[] passwordHashBytes) { await _context.Password.AddAsync(new Password() { PasswordHash = passwordHashBytes, Userid = userId }); await _context.SaveChangesAsync(true); }