N-tier web application sample with Ninject? - asp.net

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.

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.

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

Related

Is the Managed Extensibility Framework (MEF) what ASP.NET Core 2 uses internally for IoC?

I am trying to gauge if Managed Extensibility Framework (MEF) is something I can use for extending an ASP.NET Core 2.x MVC website. I saw ExtCore also. My desire is to use it to build infrastructure for plugins in my application.
What I cannot figure out is if MEF is legacy from Silverlight or if MEF is what Core actually uses for it's IoC. I know MEF is in CoreFX, but that's all I know for sure.
I'd like to use MS's IoC DI here if it is viable and not legacy. Is MEF legacy or is it used by Core itself?
Some questions I looked at, most were very old,
Is there a replacement for MEF in .NET Core (or ASP.NET 5)
In ASP.NET Core, does the IoC ASP Startup Class solve what the Managed Extensibility Framework solved with a catalog and container?
(The last one is a question I asked at the end of 2016.)

How to access configuration in windows class library project created in Asp.Net Core MVC?

I have a new Asp.Net Core MVC website. Asp.Net core only targets full .net 4.6.1 framework.
I have added another project to the solution, which is windows (not Asp.Net core) class library. This class library was developed before 2 years but recently converted to target .net framework 4.6.1. So I thought to re-use it. I was able to bring the reference in with Asp.Net core mvc site. However, I like to inject configuration (IOption) to this class library. I tried searching around but I could not find any help. I find a few posts where there was a discussion around adding a startup.cs in class library and retrieving the configuration. However, it was not quiet clear from the discussion, which type of class library they were discussing about. I think I could implement the same with class libraries build with .NET Core. However, how I can achieve the same implementation with older libraries I have.
I really appreciate any help on this. I like to access IOption service in the class library developed earlier.

ASP.net vnext Dependency Injection

I have heard that in the next version of ASP.NET (ASP.NET vnext) there will be dependency injection built into the framework.
Does anyone know more about this?
Will it be unity or a new framework?
Where can I find more information about this?
ASP.NET vNext will have built-in support for dependency injection. It is very basic support that currently supports only constructor injection.
The source repo for ASP.NET vNext's dependency injection logic contains sample implementations of how to wire up several community-built dependency injection systems, including Autofac, Ninject, StructureMap, Unity, and Castle Windsor. However, those are just samples and are not all complete or fully functional.
The idea is that for basic scenarios a developer can use the built-in DI, whereas people with more advanced requirements or if they already have a "favorite" DI system can plug that in instead and get richer features.
It will contain common abstractions for Autofac, Ninject, StructureMap, Unity, Windsor as seen here Dependency Injection github If you see in the Project.Json it has dependencies on these specific frameworks.
Here is instruction how to use Autofac with ASP.NET 5
This blog explains the details on hov to wire up your own container: http://blogs.msdn.com/b/webdev/archive/2014/06/17/dependency-injection-in-asp-net-vnext.aspx

spring framework & asp.net mvc

I heard there is a port of spring framework to .Net framework which is called spring.net.
Anyone can compare those two frameworks? If design the system, which one is prefered or both can be used.
Spring is for Java, Spring.NET is a .NET port of the Java framework.
See the overview page for a summary of the modules it implements.
You can't use both since they are written for different platforms. If you're designing the system and have the freedom to choose which platform you're implementing in, you can choose either Spring for a Java implementation or Spring.NET for a .NET implementation.
They are slowly getting a bit different, especially with the support for .NET specific things, such as WCF.
If you're going to decide to implement in .NET/Java I would take more into account than simple Spring/Spring.NET.
Spring is the original Java version and Spring.NET is a .NET version. Spring is better, as the .NET port is not as good as the original. For .NET, you are better of with Castle Windsor. The best thing is to use none of the dependency injection containers because dependency injection is not a good design pattern to follow. Neither is MVC. Java has many differences from .NET. .NET has advantage of Web Forms over Java. If you are using .NET, use the best UI platform which is Web Forms. If you are using Java use JSF.

Are there any ASP.Net MVC reference applications

I am trying to learn ASP.Net MVC framework and I was wondering if there were any good reference applications that I could use to learn about implementing ASP.Net as well as best practices for implementing LOB apps.
If possible I would like to see a ASP.Net MVC app that uses AJAX too.
NerdDinner
http://www.codeplex.com/NerdDinner
MVC Storefront
http://www.codeplex.com/mvcsamples
KIGG (MVC implementation of Digg running at dotnetshoutout.com)
http://www.codeplex.com/kigg
Oxite
http://www.codeplex.com/oxite
Code Camp Server
http://code.google.com/p/codecampserver/
CarTrackr
http://www.codeplex.com/CarTrackr
StackOverflow (no source of course)
http://www.stackoverflow.com
Nerd Dinner
Code and Tutorial available as a free chapter from ASP.Net MVC 1.0 Book by Conery, Hanselman, Haack, and Guthrie (couldn't find SO user page)
Source code also available on CodePlex
Have you looked at NerdDinner?
ScottGu' blog
also
the html tutorial for the Nerd Dinner
Oxite project (an open source blog engine)
There are however opinions that it is not that good an example to learn from:
Oxite - Oh Dear Lord Why?!
CarTrackr is a simple sample app from the book ASP.NET MVC 1.0 Quickly.

Resources