Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

N-tier web application sample with Ninject?

I am trying to learn how to use dependency injection and Ninject. I've been reading blog posts on the topic and Mark Seeman's book "Dependency Injection in .NET". While I have a general understanding of DI, I have troubles understanding how to organize code in a n-tier web application.

Does anyone know of a project sample that I can download, or a blog post to review? Even better if the sample is based on Ninject and MVC3.

like image 674
Indigo Avatar asked Dec 18 '11 20:12

Indigo


2 Answers

NerdDinner is a sample ASP.NET MVC project, and it has been updated to MVC 3: http://nerddinner.codeplex.com/

There are modified versions of the old MVC 2 version that use Ninject and Unity for dependency injection: http://nerddinneraddons.codeplex.com/ The author of those projects provided a different sample application using MVC 3 and Entity Framework 4.1: http://efmvc.codeplex.com/ but used AutoFac rather than Ninject for dependency injection.

like image 76
Martin Owen Avatar answered Nov 05 '22 01:11

Martin Owen


There's S#arp Lite, a light version of S#arp Architecture recently started by S#arp Architecture's original author.

His introductory blogposts:

  • Introducing S#arp Lite ...S#arp Architecture's pompous little sister
  • S#arp Lite: The Basics
like image 3
Christian Specht Avatar answered Nov 05 '22 02:11

Christian Specht