title: Bind generic Interface in Ninject
body: <p>So, I have dug for quite some time to find the answer for this with no luck.</p>
  
  <p>What am I doing wrong?
  <br>
  <br>
  Ninject throws an exception with this message:</p>
  
  <pre><code>Error activating IModelRepository{User}
  
  No matching bindings are available, and the type is not self-bindable.
  </code></pre>
  
  <p><br>
  Here's my code:</p>
  
  <p>I have a generic Interface:</p>
  
  <pre><code>public interface IModelRepository&lt;T&gt; where T: IModel
  {
      //interface stuff here
  }
  </code></pre>
  
  <p><br></p>
  
  <p>The concrete class is:</p>
  
  <pre><code>public UserRepository : IModelRepository&lt;User&gt;
  {
      public UserRepository(IDocumentStore documentStore, string databaseName)
      {
          //constructor code here
      }
  }
  </code></pre>
  
  <p><br>
  Ninject module Load():</p>
  
  <pre><code>public override void Load()
  {
      string databaseName = Properties.Settings.Default.DefaultDatabaseName;
  
      Bind&lt;IModelRepository&lt;User&gt;&gt;()
          .To&lt;UserRepository&gt;()
          .WithConstructorArgument("documentStore", Kernel.Get&lt;IDocumentStore&gt;())
          .WithConstructorArgument("databaseName", databaseName);
  }
  </code></pre>
  
  <p><br>
  Ninject instantiation (this is where the exception occurs):</p>
  
  <pre><code>Kernel = new Ninject.StandardKernel(new DIModules.ModelRepositoryModule()
                                     ,new DIModules.DocumentStoreModule());
  </code></pre>
  
  <p>Here's the full stack trace:</p>
  
  <pre><code>at Ninject.KernelBase.Resolve(IRequest request) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 359
  at Ninject.ResolutionExtensions.GetResolutionIterator(IResolutionRoot root, Type service, Func`2 constraint, IEnumerable`1 parameters, Boolean isOptional, Boolean isUnique) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line 263
  at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line 37
  at xl.view.DIModules.DataStoreModule.Load() in c:\Users\Michael\Google Drive\Projects\Windows\xl\xl.view\DIModules\DataStoreModule.cs:line 18
  at Ninject.Modules.NinjectModule.OnLoad(IKernel kernel) in c:\Projects\Ninject\ninject\src\Ninject\Modules\NinjectModule.cs:line 85
  at Ninject.KernelBase.Load(IEnumerable`1 m) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 217
  at Ninject.KernelBase..ctor(IComponentContainer components, INinjectSettings settings, INinjectModule[] modules) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 100
  at Ninject.KernelBase..ctor(INinjectModule[] modules) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 57
  at Ninject.StandardKernel..ctor(INinjectModule[] modules) in c:\Projects\Ninject\ninject\src\Ninject\StandardKernel.cs:line 46
  at xl.view.Program.InitializeApplication() in c:\Projects\Windows\xl\xl.view\Program.cs:line 53
  at xl.view.Program.Main() in c:\Windows\xl\xl.view\Program.cs:line 28
  </code></pre>