using Contracts.ViewModels; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; namespace WebApp.Pages { [AllowAnonymous] public class IndexModel : PageModel { public List ProductsModel { get; set; } public Dictionary> MediaByProductsModel { get; set; } public void OnGet() { ProductsModel = APIClient.GetRequest>($"Product/GetFullList"); MediaByProductsModel = APIClient.GetRequest>>($"MediaFile/GetByProducts?"); } public List GetMediaByProduct(ProductViewModel productModel) { MediaByProductsModel.TryGetValue(productModel, out List models); return models; } } }