Movies

Introduction

Welcome to the wonderful world of MVC. You should be excited! Model-View-Controller is one of the most widely used design patterns in web development. The concepts you’ll learn apply to any language or framework, not just C#. You’ll be thinking MVC on a daily basis when you get a job.

.NET provides three solutions for full-stack development: Razor Pages, Blazor and MVC. MVC is by far the most popular and it’s widely used in enterprise. While Blazor is gaining ground and more .NET teams are starting to use it, chances are you’ll have to write and/or maintain MVC code at some stage in your career.

For this initial tutorial we’ll be using the official documentation. Its MVC tutorial does a very good job at explaining the basic concepts. There will be a bit of hand-holding at first. You’ll be using .NET’s “scaffolding” (Scaffolding in ASP.NET Core is a technique used to generate code at design time to support a number of common application scenarios when working with Entity Framework Core), which is necessary given the slight complexity of the project, but if you pay attention to each line of code, by the end of this project you’ll have a good grasp of MVC basics.

Requirements

  • This is an application to manage information about movies.
  • Users should be able to Add, Delete, Update and Read from a database, using website as the front-end.
  • You need to use Entity Framework, raw SQL isn't allowed.
  • There needs to be a search functionality where I can search movies by name.
  • You should use SQL Server, not SQLite

Resources

Here are a few resources that might be helpful.

Notice that there’s a lot of talk about Razor Pages, MVVM, MVC. Those topics can be confusing. Give these texts a good read and reach out on our Discord community if it doesn’t make sense. And remember, Google is your best friend! 😁

Tips

  • In the Microsoft Docs MVC Tutorial, the first three chapters contain a simple controller with a view, for basic understanding of .NET MVC. Don't skip that part. But the actual Movie App code starts on Part 4.
  • Read every single line of the tutorial. Don't rush through the steps.
  • Once you're finished, push your final version to Github, create a new repository and do it again, step-by-step, there's a lot going on in MVC, and one time isn't enough.
  • I strongly recommend you make notes to help you connect the dots in ASP.NET MVC. There are lots of little details to learn and it will serve as a reference for your future MVC projects.

Challenges

  • Scaffolding means you're using .NET's tools to generate code for you. A very nice challenge for better retention would be to recreate the same project without scaffolding. It's ok if you copy and paste chunks of code from the original project. It will still be helpful.
  • Once you've done it twice, do it a third time, but with different data. Intead of movies, countries? Cars? Music? Sports? Anything, it will further cement your knowledge.
  • Add one or more separate areas to the app. TV Series, for example. Or music. You'd have to create different pages for each, and a link in the nav bar.

Introduction

Welcome to the wonderful world of MVC. You should be excited! Model-View-Controller is one of the most widely used design patterns in web development. The concepts you’ll learn apply to any language or framework, not just C#. You’ll be thinking MVC on a daily basis when you get a job.

.NET provides three solutions for full-stack development: Razor Pages, Blazor and MVC. MVC is by far the most popular and it’s widely used in enterprise. While Blazor is gaining ground and more .NET teams are starting to use it, chances are you’ll have to write and/or maintain MVC code at some stage in your career.

For this initial tutorial we’ll be using the official documentation. Its MVC tutorial does a very good job at explaining the basic concepts. There will be a bit of hand-holding at first. You’ll be using .NET’s “scaffolding” (Scaffolding in ASP.NET Core is a technique used to generate code at design time to support a number of common application scenarios when working with Entity Framework Core), which is necessary given the slight complexity of the project, but if you pay attention to each line of code, by the end of this project you’ll have a good grasp of MVC basics.

Requirements

  • This is an application to manage information about movies.
  • Users should be able to Add, Delete, Update and Read from a database, using website as the front-end.
  • You need to use Entity Framework, raw SQL isn't allowed.
  • There needs to be a search functionality where I can search movies by name.
  • You should use SQL Server, not SQLite

Resources

Here are a few resources that might be helpful.

Notice that there’s a lot of talk about Razor Pages, MVVM, MVC. Those topics can be confusing. Give these texts a good read and reach out on our <a target='_blank' href='https://discord.gg/JVnwYdM79C'>Discord community</a> if it doesn’t make sense. And remember, Google is your best friend! 😁

Tips

  • In the Microsoft Docs MVC Tutorial, the first three chapters contain a simple controller with a view, for basic understanding of .NET MVC. Don't skip that part. But the actual Movie App code starts on Part 4.
  • Read every single line of the tutorial. Don't rush through the steps.
  • Once you're finished, push your final version to Github, create a new repository and do it again, step-by-step, there's a lot going on in MVC, and one time isn't enough.
  • I strongly recommend you make notes to help you connect the dots in ASP.NET MVC. There are lots of little details to learn and it will serve as a reference for your future MVC projects.

Challenges

  • Scaffolding means you're using .NET's tools to generate code for you. A very nice challenge for better retention would be to recreate the same project without scaffolding. It's ok if you copy and paste chunks of code from the original project. It will still be helpful.

  • Once you've done it twice, do it a third time, but with different data. Intead of movies, countries? Cars? Music? Sports? Anything, it will further cement your knowledge.

  • Add one or more separate areas to the app. TV Series, for example. Or music. You'd have to create different pages for each, and a link in the nav bar.

An error has occurred. This application may no longer respond until reloaded. Reload 🗙