Migrating from MVC to Core MVC
The MVC technology 3, 4 and 5 has been a wonderful technology for many years. It targets versions 4.x of the .NET framework and serves its purpose well for creating amazing web applications.
ASP.NET Core is the active offering of Microsoft and provides cross-platform ground for building and running .NET apps on Linux, macOS, and Windows. This is the technology that will get updates going forward. So naturally, many people will want to choose developing Core MVC web applications.
Telerik UI has well supported and developed products for each of these technologies through its Telerik UI for ASP.NET MVC and Telerik UI for ASP.NET Core libraries.
This article aims at helping you with the process of migrating from ASP.NET MVC to ASP.NET Core.
Compatibility
The good news is that there is almost 1:1 parity between the two UI toolsets. The transition is smooth, easy, and fully feature-covered. For any minor variations, check the section about exceptions to find out where the products differ from one another.
For reference, compare the code base of the following live samples to make sure the syntax is identical:
- Telerik UI for ASP.NET MVC Data Grid Local Data Binding
- Telerik UI for ASP.NET Core Data Grid Local Data Binding
Exceptions
There are couple of differences worth mentioning to ease your migration process.
-
The MVC Grid server-rendered templates must transfer to client-rendered templates in Core Grid. Therefore, you will now use
.HeaderTemplate()
instead of.ClientHeaderTemplate()
. -
Check out the Migrate to ASP.NET Core MVC from ASP.NET Framework MVC blog post by Joe Guadagno to explore the common code-behind steps while migrating an app to ASP.NET Core MVC.
Some key takeaways from this blog are:
- Separate the Models–Putting your domain or data transfer objects into a separate project.
- Separate the Data Layer–Getting data access methods out of the user interface (web app).
- Create a New Project–Analyzing the structure differences of a project in the new technology: folders, files, and so on.
- Gotchas