Month: May 2015

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:

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. http://laravel.com/docs/5.0/artisan 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