public void SaveAccountConfirmation(AccountConfirmationInfo accountConfirmationInfo) { Data.AccountConfirmation accountConfirmation = ConvertToDb(accountConfirmationInfo); _context.AccountConfirmations.Add(accountConfirmation); _context.SaveChanges(); }
//public void DeleteAccountConfirmation(int accountId) //{ // Data.AccountConfirmation accountConfirmation = _context.AccountConfirmations.Where(x => x.AccountId == accountId).FirstOrDefault(); // if (accountConfirmation != null) // { // _context.AccountConfirmations.Remove(accountConfirmation); // _context.SaveChanges(); // } // else // { // throw new ArgumentNullException(); // } //} public AccountConfirmationInfo ConvertToFacade(Data.AccountConfirmation accountConfirmation) { return(new AccountConfirmationInfo { Id = accountConfirmation.Id, Token = accountConfirmation.Token, AccountId = accountConfirmation.AccountId }); }
public void DeleteAccountConfirmation(int id) { Data.AccountConfirmation accountConfirmation = _context.AccountConfirmations.Find(id); if (accountConfirmation != null) { _context.AccountConfirmations.Remove(accountConfirmation); _context.SaveChanges(); } else { throw new ArgumentNullException(); } }