public void AddCreditCard(ICreditCard creditCard) { if (creditCard.ExpMonth <= 0 || creditCard.ExpMonth > 12) { throw new ArgumentOutOfRangeException(nameof(creditCard.ExpMonth)); } Data.CreditCard card = MapToDataCreditCard(creditCard); card.ModifiedDate = DateTime.UtcNow; _context.AddCreditCard(card); }
public void UpdateCreditCard(int id, ICreditCard creditCard) { Data.CreditCard card = MoveToData(creditCard); card.ModifiedDate = DateTime.UtcNow; DataContext.UpdateItem(id, card); }
public void AddCreditCard(ICreditCard creditCard) { Data.CreditCard card = MoveToData(creditCard); card.ModifiedDate = DateTime.UtcNow; DataContext.AddItem(card); }
public void UpdateCreditCard(string cardNumber, ICreditCard creditCard) { Data.CreditCard card = MapToDataCreditCard(creditCard); card.ModifiedDate = DateTime.UtcNow; _context.UpdateCreditCard(cardNumber, card); }