/// <summary> /// Business logic for registering accounts from Single Sign On. /// </summary> /// <param name="registrationDto"></param> /// <returns></returns> public HttpResponseMessage RegisterPartialAccount(SsoRegistrationRequestDTO registrationDto) { // Validation Step if (_partialAccountLogic.Exists(registrationDto.Username) || _accountLogic.Exists(registrationDto.Username)) { return(new HttpResponseMessage(HttpStatusCode.Conflict)); } // Add new PartialAccount to the database var partialAccount = new PartialAccount() { UserName = registrationDto.Username, Password = registrationDto.HashedPassword, AccountType = registrationDto.RoleType }; // Add new attached Salt to the database connected with PartialAccount. var salt = new PartialAccountSalt() { PasswordSalt = registrationDto.PasswordSalt, UserName = registrationDto.Username, PartialAccount = partialAccount }; _partialAccountSaltLogic.Create(salt); return(new HttpResponseMessage(HttpStatusCode.OK)); }
public void Update(PartialAccountSalt partialAccountSalt) { _saltRepository.Update(partialAccountSalt); }
public void Delete(PartialAccountSalt partialAccountSalt) { _saltRepository.Delete(partialAccountSalt); }
public void Create(PartialAccountSalt partialAccountSalt) { _saltRepository.Insert(partialAccountSalt); }