ASP.NET Family Intro
2021-11-21
0. Intro
When we try to create an ASP.NET Core project, there are many different templates to choose from and for new starters, they might feel confused about the difference and use cases for each of them.
This article aims to provide a simple explanation about these templates starting with ASP.NET Core.
1. Main Players
- ASP.NET Core Web App (MVC)
- ASP.NET Core Web App (Razor Pages)
- ASP.NET Core Blazor
- ASP.NET Core Web API
Main Difference - How we build the UI
- ASP.NET Core Web App (MVC) and ASP.NET Core Web App (Razor Pages) are both using Razor syntax and act as Server-side rendering Web App, meaning the server will generate HTML and return to client.
- ASP.NET Core Blazor can build rich client side and server side applications using C# instead of JavaScript, it is pretty new and attracting many attentions now.
- ASP.NET Core APIs are used to create APIs, before .NET 6 we use controller to create APIs, from .NET 6 we can also create minimal APIs.
When to use which
- ASP.NET Core Web App (MVC) - larger, enterprise applications
- ASP.NET Core Web App (Razor Pages) - simpler than MVC approach
- ASP.NET Core Blazor - client-side rendering, write C# code
- ASP.NET Core Web API - create APIs
2. ASP.NET Framework VS ASP.NET Core
ASP.NET Framework support Windows only, ASP.NET Core supports cross-platform.
ASP.NET Framework 4.8 is the latest version and won’t be upgraded anymore.