Monthly Archives: January 2014

Multiple ViewModels in a single MVC View

This post shows how to use multiple models in a single view. The models can be used in separated forms or together in one form. You could use each child model with a separate ajax post if required. Only properties in the parent class affect the child models, but a property in a child model […]

Getting started with Elasticsearch and .NET

At present there are 2 main players in the full text searches for applications. Solr and Elasticsearch. Both are built using Lucene. There’s a lot of dicussion about which is the best, but for me, Elasticsearch provides some better features and seems to be growing faster. I decided to choose Elasticsearch because you require no […]

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: 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: For Serialization, the tests use an Object class with int, double, string, Object properties and also a List of […]

Web API 2 Using ActionFilterAttribute, OverrideActionFiltersAttribute and IoC Injection

ActionFilters are a great way to add extra functionality to your Web API service. This article shows examples of how the ActionFilters work together, how the filters can be overrided and how the filters can be used together with an IoC. The diagram underneath shows how the filters are called in the Web API lifecycle. […]

SignalR Message Buffers with SQLite

This post demonstrates how to set up a very basic message queue using SignalR with SQLite. This could be used to collect data from a measurement system or a client which is not always online but no data messages should be lost or the sequence of the messages. Code: Only the client contains a […]