Tag Archives: protobuf

Testing an ASP.NET Core MVC Protobuf API using HTTPClient and xUnit

The article shows how to test an ASP.NET Core MVC API using xUnit and a HTTPClient client using Protobuf for the content formatters. Code: https://github.com/damienbod/AspNetMvc6ProtobufFormatters Posts in this series: ASP.NET Core Using Protobuf Formatters Testing an ASP.NET Core MVC Protobuf API using HTTPClient and xUnit The test project tests the ASP.NET Core API produced here. […]

ASP.NET Core Using Protobuf Formatters

This article shows how to use and implement Protobuf as a custom InputFormatter and a custom OutputFormatter in ASP.NET Core. Protobuf can then be used in the HTTP requests and responses for serialization. Before ASP.NET Core, this was implemented in Web API using MediaFormatters. In ASP.NET Core, this has been split into IInputFormatter and IOutputFormatter. […]

Using Protobuf-Net Media Formatter with Web API 2

The example shows how to setup a Web API 2 service using Protobuf-Net as it Media Formatter and a HttpClient which gets and deserializes the response using Protobuf-Net. Protobuf is choosen because it’s the fastest Media Formatter at present. Code: https://github.com/damienbod/WebApi2WebApiContribProtobuf Web API 2 Server The server is just a basic Web API MVC 5 […]

Comparing Protobuf, JSON, BSON, XML with .NET for File streams

This post compares the Serialization to files using Protobuf, Json.NET (Newtonsoft) JSON and BSON, Servicestack Json and plain .NET Xml. The test measures the whole operation and not just serialization to a memory stream. Code: https://github.com/damienbod/SerializationToFileTests For Serialization, the tests use an Object class with int, double, string, Object properties and also a List of […]