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)); }
public async Task <IActionResult> GetAll() { var card = await _cardService.GetAll(); return(Ok(card)); }
public IActionResult Get() { return(Response(_CardAppService.GetAll())); }