38 lines
807 B
C#
38 lines
807 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
using System.Web.Mvc;
|
|||
|
using System.Web.Services.Description;
|
|||
|
using Ninject;
|
|||
|
|
|||
|
namespace SportsStore.WebUI.Infrastructure
|
|||
|
{
|
|||
|
public class NinjectDependencyResolver : IDependencyResolver
|
|||
|
{
|
|||
|
private IKernel kernel;
|
|||
|
|
|||
|
public NinjectDependencyResolver(IKernel kernelParam)
|
|||
|
{
|
|||
|
kernel = kernelParam;
|
|||
|
AddBindings();
|
|||
|
}
|
|||
|
|
|||
|
public object GetService(Type serviceType)
|
|||
|
{
|
|||
|
return kernel.TryGet(serviceType);
|
|||
|
}
|
|||
|
|
|||
|
public IEnumerable<object> GetServices(Type serviceType)
|
|||
|
{
|
|||
|
return kernel.GetAll(serviceType);
|
|||
|
}
|
|||
|
|
|||
|
private void AddBindings()
|
|||
|
{
|
|||
|
// put bindings here
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|