public void InsertNewUser(INewUserDto dto) { Context.Users.InsertOnSubmit(new User { Username = dto.UserName, Password = dto.Password, FullUserName = dto.FullUserName, CreationDate = DateTime.Now }); Context.SubmitChanges(); }
public void AddNewUser(INewUserDto dto) { var getSimilarUser = _usersRepository.GetUserByUsername(dto.UserName); if (getSimilarUser != null) { throw new ArgumentException("Użytkownik o takiej nazwie już istnieje w bazie"); } _usersRepository.InsertNewUser(dto); }