I’m currently migrating an existing ASP.NET MVC application to ASP.NET Core. After 3 years of working on Single Page Applications through Angular returning to MVC was as straightforward as I hoped.
As long as you stay in the full page refresh cycle, everything is quite easy but the moment you want to sprinkle some AJAX magic on top of your code, it turns into a mess quite fast.
But not all is bad. Thanks to control libraries like Kendo UI you get a lot of functionality with almost no code.
For example the Kendo Grid control is pure magic! Unfortunately it didn’t work out-of-the-box. There is 1 important extra configuration step required. You need to tell ASP.NET Core to maintain the property name casing:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
... | |
services | |
.AddControllersWithViews() | |
.AddJsonOptions(options => | |
options.JsonSerializerOptions.PropertyNamingPolicy = null); | |
// Add the Kendo UI services to the services container. | |
services.AddKendo(); | |
} |