Monthly Archives: March 2014

Web API File Upload, Single or Multiple files

This article demonstrates file uploads using Web API 2. The examples use the MultipartFormDataStreamProvider class. The controller implementation saves the files in memory first, so for large files or with a lot of HTTP traffic, this is not a good solution. Links to other examples are also included at the bottom of this post. Code: […]

Web API Help Pages

This feature of Web API seems to be still in the alpha phase. Not all required features are implemented, it has NO SUPPORT for self hosted Web API services. A lot of the links about this are old and the most projects examples don’t work with the latest Web API version. The official ASP.NET HOWTO […]

Web API Localization

This article shows how to set up a Web API service which can support multiple languages and keep it simple. When localizing an application, it is important that all texts or references to language specific resources are not directly referenced in your business methods or code. Only the source or the presentation layer should convert […]

Managing internal Dependencies in Libraries

When creating software components, it is often forgotten that it has to be easy to use. A lot of components are designed with an IoC and lots of unit tests. When using the component, the parent software should not need to create all the internal dependencies. This requires internal knowledge of the library which should […]

MessageHandlers and service Versions in Web API

The article demonstrates how different versions of the same service could be supported or not in a web API. Underneath are good links of different possibilities, which are better for different business scenarios. Depending on the client application/implementation, an update strategy could be implemented using Message Handlers. Code: Possibility One: The old version of […]

Data Transfers With Web API Batching and Protobuf

This article demonstrates how to setup up a Web API service which supports default batching as well as a custom Protobuf batch handler. Protobuf is used because it is the fastest and best serialization library which exists for .NET applications. CRUD operations are supported. Batching can be used to send multiple requests in a single […]

Using Web API with a Nest elasticsearch backend

This article demonstrates how to create a Web API RESTful service and use Elasticsearch as the persistence infrastructure. Nest is used to access Elasticsearch store. Simple CRUD is supported in the controller. code: Update 2014.09.28: updated all NuGet packages and fixed NEST, breaking changes in version 1 Structure The Application structure is based on […]