public async Task <IActionResult> Index3d(int id) { var exhibitions = await artDbRepo.GetCollection(id); var exhibitionsForRoom = await artDbRepo.GetCollectionsWithArt(); var artist = await artDbRepo.GetArtistByCollection(exhibitions); ExhibitionsViewModel exhibitionsViewModel = new ExhibitionsViewModel(exhibitions, exhibitionsForRoom, artist); return(View(exhibitionsViewModel)); }
public async Task <IActionResult> AddArtwork(string title, string description, string url, int artistId, int collectionId) { Collection collection = await artDbRepo.GetCollection(collectionId); artDbRepo.AddArtwork(collection, title, description, url); Artist artist = await artDbRepo.GetArtistById(artistId); ArtistViewModel viewModel = new ArtistViewModel(artist); return(View("Index", viewModel)); }