Skip to content

Instantly share code, notes, and snippets.

@rkusa
Created October 7, 2010 07:37
Show Gist options
  • Save rkusa/614733 to your computer and use it in GitHub Desktop.
Save rkusa/614733 to your computer and use it in GitHub Desktop.
public class NinjectDependencyResolver : IDependencyResolver
{
private IKernel _kernel;
public NinjectDependencyResolver(IKernel kernel)
{
_kernel = kernel;
}
public object GetService(Type serviceType)
{
return _kernel.TryGet(serviceType);
}
public IEnumerable<object> GetServices(Type serviceType)
{
return _kernel.GetAll(serviceType);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment