C# – Create a web app with ASP.NET Core MVC – Video

Creating a web application with ASP.NET could look as a hard task. Still, with the pre-built MVC models from Visual Studio, the task is a bit easier. This is how the application looks like, with 2 search buttons and fully implemented CRUD (Create, Read, Update, Delete) functionality:

The video includes the following steps:

  • Getting started with a HelloWorldController.cs
  • Add a controller
  • Add a view
  • Add a model
  • Work with SQL Server LocalDB
  • Controller methods and views
  • Add 2 search fields (one by genre and one by filter word)
  • Add a new field (rating 5/7)
  • Adding data validation to the model (video at the bottom of the article)

The application is built from scratch (or from New>Project) in the video here:

The most important parts of the application are probably the MoviesController.cs which is about 90% generated by Visual Studio:

And the razor view at Views>Movies>Index.cshtm with the two search fields:

Adding data validation to the project:

The rest is in GitHub here:

https://github.com/Vitosh/ASP/tree/master/MvcMovie

https://github.com/Vitosh/ASP/tree/master/MvcMovieWithDataValidation

Enjoy!

Tagged with: , , , , , ,