public MainWindowViewModel(CardRepository cardRepo) { this.cardRepo = cardRepo; var cards = cardRepo.GetAllCards(); Greeting = $"found {cards.Count()} cards!"; }
public IHttpActionResult GetCards() { try { var cards = CardRepository.GetAllCards(); return(Ok(cards)); } catch (Exception e) { Console.WriteLine(e); return(InternalServerError(e)); } }
public void TestMethod1() { var cards = Builder <Card> .CreateListOfSize(1000) .All() .Random(1) .Build(); Context.Cards.AddRange(cards); Context.SaveChanges(); var result = CardRepository.GetAllCards().Count(); Assert.AreEqual(1000, result); }
public static IEnumerable <CardVm> GetAllCards() { return(CardMapper.Map(CardRepository.GetAllCards())); }