Beispiel #1
0
        public static PaymentViewModel Create(IPaymentObject o)
        {
            switch (o)
            {
            case CheckObject check:
                return(create(check));

            case CreditCardObject credit:
                return(create(credit));

            case DebitCardObject debit:
                return(create(debit));
            }

            return(create(o as CashObject));
        }
Beispiel #2
0
 public async Task DeleteObject(IPaymentObject o)
 {
     if (o is CashObject cash)
     {
         dbSet.Remove(cash.DbRecord);
     }
     if (o is CheckObject check)
     {
         dbSet.Remove(check.DbRecord);
     }
     if (o is DebitCardObject debit)
     {
         dbSet.Remove(debit.DbRecord);
     }
     if (o is CreditCardObject credit)
     {
         dbSet.Remove(credit.DbRecord);
     }
     await db.SaveChangesAsync();
 }