2012-08-31

MEF in Asp.Net MVC 4 and WebApi

,
MEF stands for “Microsoft Extensibility Framework”. If you want an overview of MEF, you can look here. In this post we will integrated MEF with Asp.Net MVC 4 and with the WebApi. Asp.Net MVC 4 First of all you need to reference the “System.ComponentModel.Composition.dll” assembly which contains the implementation of MEF. Now where are going to create a MEF controller factory. Like the name says, it will be responsible to create the controller that is requested. public class MefControllerFactory : DefaultControllerFactory { private readonly CompositionContainer _compositionContainer; ...
Read more →

2012-08-14

Entity Framework: Database Migrations

,
If you don’t like writing SQL DDL statement, like me, than Entity Framework is very handy. With the Code-First, you can write your model and don’t need to worry about your database. It is generated for you by Entity Framework. This is very handy but what if you are working with an existing database? Or if you need to support different versions of your database? That is where database migrations come in to play. Before we start Create an Asp.Net MVC 4 application Use Nuget to install the latest version of the Entity Framework (5.0.0-rc) Because i am not...
Read more →