I'm creating a project in ASP.NET Core MVC for learning purposes. In a given part of the Microsoft guide when the scaffold technique is approached to generate the controller and views controller , I came across an instruction in some methods that left me with doubt in very confusing.
See below the Create
method as an example:
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create([Bind("ID,Title,ReleaseDate,Genre,Price")] Movie movie)
{
if (ModelState.IsValid)
{
_context.Add(movie);
await _context.SaveChangesAsync();
return RedirectToAction(nameof(Index));
}
return View(movie);
}
View the statement before the declaration of the movie
parameter. It is at this point that my doubt arose and it confused me.
Questions
[Bind("ID,Title,ReleaseDate,Genre,Price")]
passed in signature
of the Create method?