Example #1
0
 private static void PaymentWithType()
 {
     using (var data = new PaymentsEntities())
     {
         foreach (var p in data.Payments.OfType <CreditcardPayment>())
         {
             Console.WriteLine("{0} {1} {2}", p.Name, p.Amount, p.CreditCard);
         }
     }
 }
Example #2
0
 private static void PaymentsDemo()
 {
     using (var data = new PaymentsEntities())
     {
         foreach (var p in data.Payments)
         {
             Console.WriteLine("{0}, {1} - {2:C}", p.GetType().Name, p.Name,
                               p.Amount);
         }
     }
 }