コード例 #1
0
 private async Task <ProductsCompatibilityViewModel> GetProdCompViewModel()
 {
     return(new ProductsCompatibilityViewModel {
         AllProdCompatibilities = await _repoProdComp.GetAllAsync(),
         AllProducts = await _repoProd.GetAllAsync(),
         Compatibilities = await _repoComp.GetAllAsync(),
     });
 }
コード例 #2
0
        //[Authorize(Roles = "admin, user")]
        public async Task <IActionResult> Index()
        {
            var homeProducts = new HomeViewModel {
                AllProducts = await _repoProd.GetAllAsync(),
                AllProductsCompatibilities = await _repoProdComp.GetAllAsync()
            };

            return(View(homeProducts));
        }