public creditCard(credit_cards credit_card) { id = credit_card.id; number = credit_card.number; expirationDate = credit_card.expirationDate; idCustomer = credit_card.idCustomer; }
public void saveCreditCard(credit_cards creditcard) { //busco el customer customers c = context.customers.FirstOrDefault(x => x.userId == creditcard.idCustomer); if (c == null) { return; } creditcard.idCustomer = c.id; context.credit_cards.Add(creditcard); context.SaveChanges(); }