Fast JSONP Serializer powered by primitive API of Utf8Json.
This library availables for .NET Standard 2.0 only.
Nuget:
Install-Package Utf8Json.Jsonp
var p = new Person { Age = 99, Name = "foobar" };
var callback = "callbackFunc";
// result: callbackFunc({"Age":99,"Name":"foobar"});
// obj -> byte[]
byte[] bytes = Jsonp.Serialize(callback, p);
// write to stream
using (var stream = new MemoryStream())
{
Jsonp.Serialize(stream, callback, p);
}
- Dynamic Serialization
- AspNetCoreMvcFormatter