コード例 #1
0
        public ActionResult Create()
        {
            ProductManagerViewModel viewModel = new ProductManagerViewModel();

            viewModel.Product           = new Product();
            viewModel.Productcategories = productCategories.Collection();

            return(View(viewModel));
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: SteveVilotti/MyShop
        public ActionResult Index(string category = null)
        {
            List <Product>         products;
            List <ProductCategory> categories = productCategories.Collection().ToList();

            if (category == null)
            {
                products = context.Collection().ToList();
            }
            else
            {
                products = context.Collection().Where(p => p.Category == category).ToList();
            }
            ProductListViewModel model = new ProductListViewModel();

            model.Products          = products;
            model.Productcategories = categories;
            return(View(model));
        }
コード例 #3
0
        // GET: ProductManager
        public ActionResult Index()
        {
            List <Product> products = context.Collection().ToList();

            return(View(products));
        }
コード例 #4
0
        // GET: ProductManager
        public ActionResult Index()
        {
            List <ProductCategory> productCategory = context.Collection().ToList();

            return(View(productCategory));
        }