ASP.NET Core MVC remains a solid choice for building web applications, but what if you want to start using Blazor for some of your projects? How do you migrate from MVC to Blazor and what pitfalls should you look out for along the way?
If you’re planning to take an existing MVC app and migrate all (or parts) of it to Blazor, the key is to break this down into smaller steps; you’re going to find it much easier to migrate an app if you do it in stages.
One sustainable approach is to migrate one view at a time.
Say you wanted to take this user list page and migrate it from MVC to Blazor:
Here’s how I would tackle it:
@code
section for the new component declare a Model
property of the same type as the one the view currently references.#mvc #blazor #asp.net core