Пример #1
0
 public ActionResult Create([Bind(Include = "SubcategoryID,Name,UI,Image")] SubcategoryViewModel subcategory, int catid)
 {
     if (ModelState.IsValid)
     {
         subcategory.CategoryID = catid;
         _subcategoryService.Add(subcategory);
         return(RedirectToAction("Index", "SubcategoryProperty", new { id = subcategory.SubcategoryID }));
     }
     ViewBag.CategoryID = new SelectList(_categoryService.GetAll(), "CategoryID", "Name", subcategory.CategoryID);
     return(View(subcategory));
 }