Beispiel #1
0
        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));
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public static IEnumerable <CardVm> GetAllCards()
 {
     return(CardMapper.Map(CardRepository.GetAllCards()));
 }