feffernoogan
New Coder
Hello, I have completed this tutorial online: Get Started with ASP.NET Core MVC https://learn.microsoft.com/en-us/a...rt-mvc?view=aspnetcore-6.0&tabs=visual-studio
I have also converted the movie database to display as a grid using Kendo UI jQuery. The movies displays how they are supposed to, but now I want to add additional features such as updating, destroying, and creating. So far, I have updated my Index.cshtml file to reflect the proper 'transpose' criteria. However, I am having trouble creating the 'update' method in the controller. Is someone able to provide some assistance with this? Any help is much appreciated.
Here is my code so far from the 'Movies_Read' method and the 'Movies_Update' method (the second one I have trouble with):
I have also converted the movie database to display as a grid using Kendo UI jQuery. The movies displays how they are supposed to, but now I want to add additional features such as updating, destroying, and creating. So far, I have updated my Index.cshtml file to reflect the proper 'transpose' criteria. However, I am having trouble creating the 'update' method in the controller. Is someone able to provide some assistance with this? Any help is much appreciated.
Here is my code so far from the 'Movies_Read' method and the 'Movies_Update' method (the second one I have trouble with):
C#:
public async Task<IActionResult> Movies_Read(DataSourceRequest request)
{
var movies = _context.Movie.ToList();
DataSourceResult result = new DataSourceResult();
result.Data = movies.AsQueryable();
result.Total = movies.Count;
return Json(new
{
data = result,
});
}
// POST: Movies_Update
[HttpPost] // All the methods that create, edit, delete, or otherwise modify data do so in the[HttpPost] overload of the method
public async Task<IActionResult> Movies_Update([DataSourceRequest] DataSourceRequest request, Movie movie)
{
}