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

  • ASP.NET MVC 3
  • Entity Framework 4.1 Code First
  • Microsoft Unity 2.0
  • jQuery Mobile

The following are the main features of the web application

  • CRUD demo in ASP.NET MVC 3 with Entity Framework 4.1 Code First
  • Razor View Engine
  • Generic repository for Entity Framework 4.1 Code First
  • Repository Pattern and Unit of Work
  • Dependency Injection using Unity 2.0
  • Mobile specific pages using JQuery Mobile
  • ASP.NET MVC Area for Mobile specific pages
  • Automatic redirection to mobile specific pages if users are accessing from Mobile browsers.
  • Using EF 4.1 Code First with a custom Membership/Role providder (Altairis Web Security Toolkit)

13 Comments

  • Very cool stuff - looking forward to checking this out.

  • Thanks for interesting post.

  • Hi, running your application produces several of the following exception:

    A first chance exception of type 'Microsoft.Practices.Unity.ResolutionFailedException' occurred in Microsoft.Practices.Unity.DLL

    Despite the exception, the app works fine. Could you please elaborate on where the exception is coming from and how to remove it?

    Thanks

  • @Dave - I could not getting this exception from my system

  • When I am deploying this application on IIS 6.0, it gives me error "There is no parameterless constructor". Can u please address this?

  • @Neeraj Kumar - This demo app is using Unity IoC container for creating controller instances. This error is normally getting when our controller class has constructor with parameters and could not able to create controller instance using IoC container.Please ensure that IoC is configured properly.

  • This is really awesome. Setting up the project structure for DDD has been taking me several days in my spare time. Once I get the Dependency Injection and authentication stuff worked out I think this could really change the way we design our software in the future.

  • Very good example! Although seams that repository/service layers affect ability to created WCF Data Service on top of EF… Any pointers?

  • Thank you, this is an very good example.
    It would be very useful, if you could add some demo unit tests to see how they work with Unity and so on.

    Regards, Patrick

  • Love your work - very helpful for building my MVC app for desktop and mobile.

    Thanks V much

  • nice i downloaded and i am learning with it!

  • This is breaking ground - especially with th re-routing based on mobile platform add-in - really cool. With a DB of over 800 tables, I hade to create a custom code generator to create the repositories, however, I was able to do so. I am now looking for wa way to not have to write a coupled service for each entitu - does anyone know if a way to abstract the remote CRUD operations. For instance webserver w/MVC WCF Service DB, with the WCF Service having an abstract way of updating DbSets or Entity objects ? Thanks, Tom

  • Hello, I enjoy reading through your post. I wanted to write a little comment to support you.

Comments have been disabled for this content.