Category Protobuf

gRPC Bi-directional streaming with Razor Pages and a Hosted Service gRPC client

This article shows how a Bi-directional streaming gRPC service could be implemented using an .NET Core Hosted Service as a gRPC client, and a Razor Page to send Bi-directional streaming messages to the servers connected clients. Code: https://github.com/damienbod/Secure_gRpc Posts in this series Security Experiments with gRPC and ASP.NET Core 5 Running Razor Pages and a […]

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/AspNetCoreMvcProtobufFormatters Posts in this series: ASP.NET Core Using Protobuf Formatters Testing an ASP.NET Core MVC Protobuf API using HTTPClient and xUnit 2019-01-30 Updated to ASP.NET Core 2.2 2017-08-17 Updated ASP.NET Core […]

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 […]