Shiju Varghese's Blog
Cloud First and Mobile First
-
NoSQL with RavenDB and ASP.NET MVC - Part 1
Source Code - http://ravenmvc.codeplex.com
-
Dependency Injection in ASP.NET MVC NerdDinner App using Unity 2.0
In my previous post Dependency Injection in ASP.NET MVC NerdDinner App using Ninject, we did dependency injection in NerdDinner application using Ninject. In this post, I demonstrate how to apply Dependency Injection in ASP.NET MVC NerdDinner App using Microsoft Unity Application Block (Unity) v 2.0.
Unity 2.0
Unity 2.0 is available on Codeplex at http://unity.codeplex.com . In earlier versions of Unity, the ObjectBuilder generic dependency injection mechanism, was distributed as a separate assembly, is now integrated with Unity core assembly. So you no longer need to reference the ObjectBuilder assembly in your applications. Two additional Built-In Lifetime Managers - HierarchicalifetimeManager and PerResolveLifetimeManager have been added to Unity 2.0.
Dependency Injection in NerdDinner using Unity
In my Ninject post on NerdDinner, we have discussed the interfaces and concrete types of NerdDinner application and how to inject dependencies through controller constructors. The following steps will configure Unity 2.0 to apply controller injection in NerdDinner application. -
Microsoft Unity 2.0 Released
Microsoft's dependency injection framework Unity Application Block (Unity) has reached version 2.0. The release available on Codeplex at http://unity.codeplex.com/ -
Dependency Injection in ASP.NET MVC NerdDinner App using Ninject
In this post, I am applying Dependency Injection to the NerdDinner application using Ninject. The controllers of NerdDinner application have Dependency Injection enabled constructors. So we can apply Dependency Injection through constructor without change any existing code. A Dependency Injection framework injects the dependencies into a class when the dependencies are needed. Dependency Injection enables looser coupling between classes and their dependencies and provides better testability of an application and it removes the need for clients to know about their dependencies and how to create them. If you are not familiar with Dependency Injection and Inversion of Control (IoC), read Martin Fowler’s article Inversion of Control Containers and the Dependency Injection pattern.
The Open Source Project NerDinner is a great resource for learning ASP.NET MVC. A free eBook provides an end-to-end walkthrough of building NerdDinner.com application. The free eBook and the Open Source Nerddinner application are extremely useful if anyone is trying to lean ASP.NET MVC. The first release of Nerddinner was as a sample for the first chapter of Professional ASP.NET MVC 1.0. Currently the application is updating to ASP.NET MVC 2 and you can get the latest source from the source code tab of Nerddinner at http://nerddinner.codeplex.com/SourceControl/list/changesets. I have taken the latest ASP.NET MVC 2 source code of the application and applied Dependency Injection using Ninject and Ninject extension Ninject.Web.Mvc.
Ninject & Ninject.Web.Mvc
Ninject is available at http://github.com/ninject and Ninject.Web.Mvc is available at http://github.com/ninject/ninject.web.mvc
Ninject is a lightweight and a great dependency injection framework for .NET. Ninject is a great choice of dependency injection framework when building ASP.NET MVC applications. Ninject.Web.Mvc is an extension for ninject which providing integration with ASP.NET MVC.
Controller constructors and dependencies of NerdDinner application -
ASP.NET MVC ModelCopier
In my earlier post ViewModel patten and AutoMapper in ASP.NET MVC application, We have discussed the need for View Model objects and how to map values between View Model objects and Domain model objects using AutoMapper. ASP.NET MVC futures assembly provides a static class ModelCopier that can also use for copying values between View Model objects and Domain model objects. ModelCopier class has two static methods - CopyCollection and CopyModel.CopyCollection method would copy values between two collection objects and CopyModel would copy values between two model objects.
-
NoSQL with MongoDB, NoRM and ASP.NET MVC - Part 2
In my last post, I have given an introduction to MongoDB and NoRM using an ASP.NET MVC demo app. I have updated the demo ASP.NET MVC app and a created a new drop at codeplex. You can download the demo at http://mongomvc.codeplex.com/
In my last post, we have discussed to doing basic CRUD operations against a simple domain entity. In this post, let’s discuss on domain entity with deep object graph.
The below is our domain entities -
NoSQL with MongoDB, NoRM and ASP.NET MVC - Part 1
Source Code - http://mongomvc.codeplex.com
-
ASP.NET MVC Case Studies
The below are some of the case studies of ASP.NET MVC
-
Installing ASP.NET MVC 2 RTM on Visual Studio 2010 RC
Visual Studio 2010 RC is built against the ASP.NET MVC 2 RC version but you can easily install ASP.NET MVC 2 RTM on the Visual Studio 2010 RC. For installing ASP.NET MVC 2 RTM, do the following steps
-
ASP.NET MVC 2 RTM Released !
ASP.NET MVC 2 Framework has reached RTM version. You can download the ASP.NET MVC 2 RTM from here. There is not any new breaking changes were introduced by the ASP.NET MVC 2 RTM release.