Esempio n. 1
0
 public static IList<Card> ListAllCards()
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     IQueryable<Card> query = cardRepository.GetAll<Card>();
     query = cardRepository.IncludeAllRelations(query);
     return query.ToList(); 
   }      
 }
Esempio n. 2
0
 public static Card GetCardByDevicePath(string devicePath)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     var query = cardRepository.GetQuery<Card>(c => c.DevicePath == devicePath);
     query = cardRepository.IncludeAllRelations(query);
     Card card = query.ToList().FirstOrDefault(); 
     return card;
   }            
 }
Esempio n. 3
0
 public static Card GetCard(int idCard, CardIncludeRelationEnum includeRelations)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     IQueryable<Card> query = cardRepository.GetQuery<Card>(c => c.IdCard == idCard);
     query = cardRepository.IncludeAllRelations(query, includeRelations);
     Card card = query.ToList().FirstOrDefault();
     return card;
   }
 }