public ActionResult Create() { ProductManagerViewModel viewModel = new ProductManagerViewModel(); viewModel.Product = new Product(); viewModel.ProductCategories = productCategories.Collection(); return(View(viewModel)); }
public ActionResult Create() { ViewModelProductManager viewModel = new ViewModelProductManager(); viewModel.Product = new ModelProduct(); viewModel.ProductCategories = cRepositoryCategories.Collection(); return(View(viewModel)); }
public ActionResult Create() // method to create product - displays page to fill in product details { ProductManagerViewModel viewModel = new ProductManagerViewModel(); viewModel.Product = new Product(); viewModel.ProductCategories = productCategories.Collection(); return(View(viewModel)); }
public ActionResult Create() { // Before we are passing only Product as shown below //============================================================= //Product MyProduct = new Product(); //return View(MyProduct ); //============================================================= // but now we make a view model whcih contains one Product data // and collection of Product Catagories table data // and we are now passing this view model to Create Class ProductandCatagoryViewModel MyViewModel = new ProductandCatagoryViewModel(); MyViewModel.Product = new Product(); // we are passing one record of Product MyViewModel.ProductCatagories = ProdCatagRepositry.Collection(); // we are passing collection of Product Catagory to view return(View(MyViewModel)); }
// GET: productManager public ActionResult Index() { List <Product> products = context.Collection().ToList(); return(View(products)); // return View }
// GET: ProductManager public ActionResult Index() { //List<ProductCatagory> MyProductCatagory = MyProdCatagoryRep.Collection().ToList(); List <ProductCatagory> MyProductCatagory = MyProdCatagoryRep.Collection().ToList(); return(View(MyProductCatagory)); }
public async Task <List <CoffeeModel> > Handle(CoffeeListQuery request, CancellationToken cancellationToken) { var items = await _repository.Collection(); if (!items.Any()) { throw new Exception($"No Items were found"); } return(items); }
// GET: ProductCategoryManager public ActionResult Index() { List <ProductCategory> productCategories = context.Collection().ToList(); return(View(productCategories)); }
// GET: ProductManager public ActionResult Index() { List <Product> MyProduct = MyProdRep.Collection().ToList(); return(View(MyProduct)); }
public ActionResult Index() { List <ModelProduct> ltProducts = cRepositoryProducts.Collection().ToList(); return(View(ltProducts)); }
// GET: ProductCategoryManager public ActionResult Index() { List <ProductCategory> category = contextCategory.Collection().ToList(); return(View(category)); }