Skip to content
Permalink
Browse files

Support self service bindings for Ninject

  • Loading branch information...
tyrotoxin committed Nov 3, 2018
1 parent b8ffbeb commit 451a5425082f444b41ec993c0af75ea30efe9b0c
Showing with 13 additions and 0 deletions.
  1. +13 −0 IoC/IoC.Ninject/NinjectServiceBindingExtensions.cs
@@ -47,6 +47,19 @@ public static class NinjectServiceBindingExtensions
}
}
}

if (serviceType == null)
{
var selfBindings = syntax.Kernel.GetBindings(typeof(TImplementation)).ToList();
foreach (var binding in selfBindings)
{
if (ReferenceEquals(binding.BindingConfiguration, syntax.BindingConfiguration))
{
serviceType = typeof(TImplementation);
break;
}
}
}
}

if (serviceType == null)

0 comments on commit 451a542

Please sign in to comment.
You can’t perform that action at this time.