예제 #1
0
        public ActionResult Index()
        {
            var collectionManagement = new List <CollectionManagementViewModel>();

            var cards      = _cardAppService.GetAll();
            var rarity     = _rarityAppService.GetAll();
            var collection = _collectionAppService.GetAll();
            var collector  = _collectorAppService.GetAll();

            foreach (var card in cards)
            {
                collectionManagement.Add(new CollectionManagementViewModel
                {
                    CardDescription       = card.Description,
                    CardNumber            = card.CardNumber,
                    CollectionDescription = collection.FirstOrDefault(s => s.CollectionId == card.CollectionId).Description,
                    RarityAbbreviation    = rarity.FirstOrDefault(s => s.RarityId == card.RarityId).Abbreviation,
                });
            }

            return(View(collectionManagement));
        }
예제 #2
0
        public async Task <IActionResult> GetAll()
        {
            var card = await _cardService.GetAll();

            return(Ok(card));
        }
예제 #3
0
 public IActionResult Get()
 {
     return(Response(_CardAppService.GetAll()));
 }