Contents tagged with IoC
-
Releasing SocialGoal - Reference Web App for ASP.NET MVC 5, EF 6 Code First, AutoMapper, Autofac, TDD and DDD
My team at Marlabs, developed and released a sample reference web app for the Microsoft ASP.NET stack, named “SocialGoal” . SocialGoal is a social networking web app for socializing your goals and strategies with people. People can create goals and can be shared across the network of SocialGoal users. This app is built with ASP.NET MVC 5, EF 6 Code First, AutoMapper, Autofac, Twitter Bootstrap and following Test-Driven Development (TDD) and Domain Driven Design (DDD). The first drop of the application is available on github at https://github.com/MarlabsInc/SocialGoal. A release note is available in the docs folder of the project repository. The primary objective of the SocialGoal app is to provide a learning app for building real-world web apps with ASP.NET MVC 5 and EF 6 Code First.
-
EFMVC Migrated to .NET 4.5, Visual Studio 2012, ASP.NET MVC 4 and EF 5 Code First
I have just migrated my EFMVC app from .NET 4.0 and ASP.NET MVC 4 RC to .NET 4.5, ASP.NET MVC 4 RTM and Entity Framework 5 Code First. In this release, the EFMVC solution is built with Visual Studio 2012 RTM. The migration process was very smooth and did not made any major changes other than adding simple unit tests with NUnit and Moq. I will add more unit tests on later and will also modify the existing solution.
-
EFMVC App Migrated to Visual Studio 2012 RC and ASP.NET MVC 4 RC
I have just migrated my EFMVC app from ASP.NET MVC 4 Beta to ASP.NET MVC 4 RC. In this release, the EFMVC solution is built with Visual Studio 2012. The migration process was very smooth and did not made any major changes other than adding AutoMapper for mapping between View Model objects and Domain Model objects.
-
Dependency Injection in ASP.NET Web API using Autofac
In this post, I will demonstrate how to use Dependency Injection in ASP.NET Web API using Autofac in an ASP.NET MVC 4 app. The new ASP.NET Web API is a great framework for building HTTP services. The Autofac IoC container provides the better integration with ASP.NET Web API for applying dependency injection. The NuGet package Autofac.WebApi provides the Dependency Injection support for ASP.NET Web API services.
-
Commands, Command Handlers and Command Dispatcher
In this post, I am trying to add some CQRS principles onto my EFMVC project. EFMVC is a small web app for demonstrating ASP.NET MVC and EF Code First. Please keep in mind that this is not the implementation CQRS patterns, but trying to add some CQRS flavors on the Solution Architecture with Commands that changes the data (Create, Update and Delete). The current implementation of command execution is implemented in a synchronous way.
-
EFMVC 1.0 Preview Released
A while ago, I have released EFMVC, a demo web app built using ASP.NET MVC 3, EF Code First and Unity. The EFMVC app has demonstrated many architectural patterns and practices such as Generic Repository, Repository pattern, Unit of Work pattern, Dependency Injection pattern and Application Service later. Today I would like to announce the release of EFMVC 1.0 Preview. This release is an early preview release that has made some changes in the solution architecture. The preview is written in ASP.NET MVC 3 version and will be migrated to ASP.NET MVC 4 with new features on later.
-
Autofac - My Choice of IoC Container
I have been using Unity for dependency injection since the early days of ASP.NET MVC framework. Recently I have evaluated other IoC containers and really impressed with Autofac. The next version of my codeplex project EFMVC will be use Autofac as IoC container. Autofac is a lightweight IoC container that providing better performance and can easily integrate with .NET applications. Autofac is developed by Nicholas Blumhardt and the community is actively working on the code base.
-
Auto Registration in Microsoft Unity
Unlike many other .NET IoC containers, Microsoft Unity does not support auto registrations. Auto registration is a very useful feature for any IoC container and it would be very helpful in some specific contexts. The Unity Auto Registration project in Codeplex will provide the support for automatic registration using a fluent API. You can add Unity Auto Registration package using NuGet. The following command will add reference to Unity Auto Registration.
PM> Install-Package UnityAutoRegistration
The following registration syntax will scan the all assemblies except system assemblies and will register all types that implemented the open generic type ICommandHandler<> -
EFMVC – A demo web app using ASP.NET MVC 3 and EF 4.1 Code First
I have created a demo web app for some of my previous blog posts and can be download from http://efmvc.codeplex.com/. The following technologies are used for the web app
-
Dependency Injection in ASP.NET MVC 3 using DependencyResolver and ControllerActivator
In my previous examples for dependency injection in ASP.NET MVC, I have used an approach where creating a custom controller factory deriving from DefaultControllerFactory and override the GetControllerInstance method for dependency injection. But ASP.NET MVC 3 is providing great support for dependency injection with very nice abstraction. In this post, I will demonstrate how to achieve dependency injection using two interfaces introduced in ASP.NET MVC 3 - IDependencyResolver and IControllerActivator. Unity 2.0 will be using as the dependency injection container for this demo app.