Working with JSON in ASP.NET Core 3.0

Posted by Anuraj on Thursday, February 14, 2019 Reading time :1 minute

ASP.NET Core

This post is about working with JSON data type in ASP.NET Core 3.0. JSON stands for JavaScript Object Notation, which is an Open standard light weight format for storing and transporting data. JSON.NET was a popular library which was used in ASP.NET for working with JSON. As part of making the ASP.NET Core tidy support for JSON.NET removed from ASP.NET Core.

Now JSON.NET is available as nuget package and you need to install this explicitly.

JSON.NET Package

Once you install you can enable it using the AddNewtonsoftJson() method, like this.

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc()
        .AddNewtonsoftJson();
}

And now you can start using the JSON.NET features in ASP.NET Core, like JsonProperty attributes etc.

In ASP.NET Core 3.0, as set of new JSON APIs also available, that are highly tuned for performance by using Span<T> and allows for processing UTF-8 directly without having to transcode to UTF-16 string instances.

Happy Programming :)

What do you think? I would like to hear your thoughts, suggestions, and questions in the comments section below.


Similar Posts


Did you like this article? Share it with your friends

Facebook Twitter Google+ LinkedIn Reddit StumbleUpon



Translate
Subscribe
BMC logoBuy me a coffee


Copyright © 2019 - Anuraj P. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Hosted with ❤ by GitHub