I have a fair idea of using the Repository Pattern and have been attempting to \"upgrade\" our current way of creating ASP .Net websites. So i do the following
Install Ninject.Web either from "Package Manager Console" or NuGet.
Version is 3.2.1 as of this writing.
OR
It will install the following 4 packages -
public interface IUserService
{
List GetUsers();
}
public class UserService : IUserService
{
public List GetUsers()
{
return new List {"john", "eric"};
}
}
Then add binding to ~/App_Start/NinjectWebCommon.cs
.
In code behind page, property inject using [Inject]
attribute.