Are you awaiting at the right place?


The C# language features async and await are very easy to use, straight forward and available right out of the box in the .NET framework. But it seems the idea behind async & await has some confusions in implementations, especially where you await in the code. The asynchronous feature boasts about the responsiveness, but it…

HttpResponseMessage vs IHttpActionResult


In Web API 2 IHttpActionResult is introduced. Read this post which explains the Web API 2 response types and the benefits of IHttpActionResult Assuming you’ve read the above article it is recommended to use IHttpActionResult. Apart from the benefits of clean code and unit testing the main design argument of using IHttpActionResult is the single…

Generating code using System.CodeDom


Get the code sample for this post git We face several occasions that we need to generate code by automation. Several tools do exist in order to automate the code generation. In this article I discuss about the System.CodeDom which is part of .NET SDK. CodeDom is designed in the provider model and it gives…

How to create a certificate authentication with Azure Management Service


In order to carry out any management tasks in Azure using an agent (Visual Studio or any custom code), it should authenticate itself with Azure. Requests to the Azure Management API should be authenticated using on of the following methods. Active Directory Certificate Authentication This article covers the certificate authentication. Azure Management Service (AMS) APIs…

How to enable sessions in Web API


Web API does not support native HTTP sessions. And it’s the nature of Web API, but there might be times you need HTTP sessions which resembles your bad design. Because a service framework should not support HTTP sessions as it should be a stateless element. So why do we need sessions in Web API ?…

Windows Azure Caching


Role Based Caching Windows Azure provides 2 primary role based caching options. Shared caching and Dedicated caching. Shared Caching is defining a portion of the memory of the web or worker role. This does not include additional charges since you’re already paying for the cloud service instance and using the portion of the memory. This…