public async Task <IActionResult> Create([Bind("itemId,Title,ReleaseDate,Genre,Price")] item item) { if (ModelState.IsValid) { _context.Add(item); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(item)); }
public async Task <IActionResult> Create([Bind("Product_TypeId,type")] Product_Type product_Type) { if (ModelState.IsValid) { _context.Add(product_Type); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product_Type)); }
public IActionResult Create([Bind("UserId,ProviderID")] User_Provider user_Provider) { if (ModelState.IsValid) { _context.Add(user_Provider); _context.SaveChanges(); return(RedirectToAction(nameof(Index))); } ViewData["ProviderID"] = new SelectList(_context.Providers, "ProviderID", "ProviderName", user_Provider.ProviderID); ViewData["UserId"] = new SelectList(_context.Users, "UserId", "UserAddress", user_Provider.UserId); return(View(user_Provider)); }