public async Task <IActionResult> Create([Bind("Id,RatingValue")] Rating rating) { if (ModelState.IsValid) { _context.Add(rating); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rating)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,UserName")] Writer writer) { if (ModelState.IsValid) { _context.Add(writer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(writer)); }
public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Country,Description,Genre,RatingId")] Movie movie) { if (ModelState.IsValid) { _context.Add(movie); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["RatingId"] = new SelectList(_context.Rating, "Id", "RatingValue", movie.RatingId); return(View(movie)); }