Revealing Module Pattern
Revealing Module Pattern

Using closures in javascript, we can create public and private methods. Only the methods and variables that are specifically returned are available publicly and we can provide references to privately declared methods and variables inside the public methods. Layout for RMP: var applicationModule = (function() { //private variable. Existence limited within //this closure var privateVariable... » read more

Image File as Response from .NET Web API

When developing a web API, it is often required to send response as a PDF or image file.Following lines of code will assist to create method that will override the default media type of the response determined by Content Negotiation. public HttpResponseMessage GetImage()        {            byte[] bytes =... » read more

Automating Development in ASP.NET MVC

Inspired by rapid development framework Artisan in Laravel for PHP, I am thinking maybe we (.NET developers) can do something similar in our environment as well. Basically I am thinking of automating the whole process of creating Repository classes (including required entries for properties and fields), Model classes,  Service layer (layer where you put... » read more