Exemplo n.º 1
0
 public static IEnumerable <Card> GetAllCards()
 {
     try
     {
         using (PaymentAgentEntities db = new PaymentAgentEntities())
         {
             return(db.Card);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Exemplo n.º 2
0
 public static Card GetCardById(int cardId)
 {
     try
     {
         using (PaymentAgentEntities db = new PaymentAgentEntities())
         {
             return(db.Card
                    .SingleOrDefault(x =>
                                     x.CardID.Equals(cardId)));
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }