public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Price")] Movies movies) { if (ModelState.IsValid) { _context.Add(movies); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(movies)); }
public async Task <IActionResult> Create([Bind("ProductCategoryId,ParentProductCategoryId,Name,Rowguid,ModifiedDate")] ProductCategory productCategory) { if (ModelState.IsValid) { db.Add(productCategory); await db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ParentProductCategoryId"] = new SelectList(db.ProductCategory, "ProductCategoryId", "Name", productCategory.ParentProductCategoryId); return(View(productCategory)); }