public static UserDto MergeUserWithAzureData(User userFromRepo, Microsoft.Graph.User userFromAzureAd, IMapper mapper) { var dtoFromDb = mapper.Map <UserDto>(userFromRepo); return(mapper.Map(userFromAzureAd, dtoFromDb)); }
public void DeleteUser(User user) { if (user == null) { throw new ArgumentNullException(nameof(user)); } _context.Users.Remove(user); }
public void UpdateUser(User user) { foreach (var smartLockUser in user.SmartLockUsers) { smartLockUser.UserId = user.Id; } _context.Entry(user).State = EntityState.Modified; }
public void AddUser(User user) { if (user == null) { throw new ArgumentNullException(nameof(user)); } foreach (var smartLockUser in user.SmartLockUsers) { smartLockUser.UserId = user.Id; } _context.Users.Add(user); }