public void CreateUser(UserServiceEntity user) { if (user == null) throw new ArgumentNullException(nameof(user)); var userDalEntity = user.ToDalEntity(); _repository.Create(userDalEntity); _uow.Commit(); }
public void UpdateUser(UserServiceEntity user) { if (user == null) throw new ArgumentNullException(nameof(user)); var updatedUser = GetUserById(user.Id); if (updatedUser == null) throw new ArgumentException($"User with id = {user.Id} cannot be found.", nameof(user)); _repository.Update(user.ToDalEntity()); _uow.Commit(); }