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. This article aims to help you with the process of migrating from MVC to Core MVC if this happens to be your decision.
Compatibility
The good news is that there is almost 1:1 parity between the two UI toolsets. The transition should be smooth, easy and fully feature covered.
For reference, you can compare the Code base of these two live samples and you will notice that the syntax is identical:
Exceptions
There are couple of differences worth mentioning to ease your migration process.
MVC Grid server rendered templates should transfer to client rendered templates in Core MVC Grid. Therefore, you will now use
.HeaderTemplate()
instead of.ClientHeaderTemplate()
.-
We have a Blog post covering common code-behind steps:
The rest are syntax sugar differences caused by the frameworks themselves. For instance, here is a Validation action definition of the Upload component in MVC:
public ActionResult Validation_Save(IEnumerable<HttpPostedFileBase> files)
{
}
And this is the equivalent implementation in Core MVC:
public async Task<ActionResult> Validation_Save(IEnumerable<IFormFile> files)
{
}
-
The same is true for the Startup.cs file:
-
You can check this nice MSDN article for general points when migrating:
Migrating from Another Technology
If you are coming from another Telerik UI toolset, we have resources addressing this situation as well: