title: Repository cannot be used as a type parameter in the generic type of method
body: <p>I recently came across a problem which I haven't met before about dependencies and looked it up and found Ninject. I have followed a guide on how to use it and have reached a point where I receive and error which I do not understand. I very generally wrote down the error in the title but the full error is as follows:</p>
  
  <blockquote>
    <p>'Error    1   The type 'MyDBFirstAP.Repository.SQLAPRepository' cannot be
    used as type parameter 'TImplementation' in the generic type or method
    'Ninject.Syntax.IBindingToSyntax.To()'. There is
    no implicit reference conversion from
    'MyDBFirstAP.Repository.SQLAPRepository' to
    'MyDBFirstAP.Repository.IAPRepository'.'</p>
  </blockquote>
  
  <p>It occurs here:</p>
  
  <pre><code>public class NinjectControllerFactory : DefaultControllerFactory{
      private IKernel ninjectKernel;
  
      public NinjectControllerFactory() {
          ninjectKernel = new StandardKernel();
          AddBindings();
      }
      protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType) {
          return controllerType == null
              ? null
              : (IController)ninjectKernel.Get(controllerType);
      }
      private void AddBindings()
      {
          ninjectKernel.Bind&lt;IAPRepository&gt;().To&lt;SQLAPRepository&gt;(); // On this line
      }
  }
  </code></pre>
  
  <p>The beginning of my controller is as: </p>
  
  <pre><code> public class ClientsController : Controller
      {
          IAPRepository repository;
  
          // GET: Clients
          public ClientsController(IAPRepository repository) {
              this.repository = repository;
          }
  </code></pre>
  
  <p>Here is the requested SQLRepository code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using MyDBFirstAP.Models;
  using MyDBFirstAP.DI;
  
  namespace MyDBFirstAP.Repository {
      public class SQLAPRepository {
          ApplicationDbContext Database = new ApplicationDbContext();
  
          #region Client
          public IQueryable&lt;Client&gt; GetAllClients() {
              return Database.Clients;
          }    
  
          public Client GetClientByID(int id) {
              return Database.Clients.FirstOrDefault(c =&gt; c.ClientID == id);
          }
  
          public IQueryable&lt;Client&gt; GetClientByName(string ClientName) {
  
              return (from clients in Database.Clients
                      where clients.ClientName.Contains(ClientName)
                      select clients);
  
          }
  
          public void AddClient(Client client) {
              Database.Clients.Add(client);
              Database.SaveChanges();
          }
  
          public void UpdateClient(Client client) {
              var tmpClient = Database.Clients.FirstOrDefault(c =&gt; c.ClientID == client.ClientID);
              tmpClient.ClientName = client.ClientName;
              tmpClient.ClientAddress = client.ClientAddress;
              Database.SaveChanges();
          }
          public void DeleteClient(Client client) {
              Database.Clients.Remove(client);
              Database.SaveChanges();
          }
  #endregion
  
          #region Supplier
          public IQueryable&lt;Supplier&gt; GetAllSuppliers() {
              return Database.Suppliers;
          }
  
          public Supplier GetSupplierByID(int id) {
              return Database.Suppliers.FirstOrDefault(s =&gt; s.SupplierID == id);
          }
  
          public IQueryable&lt;Supplier&gt; GetSupplierByName(string SupplierName) {
              return(from suppliers in Database.Suppliers
                         where suppliers.SupplierName.Contains(SupplierName)
                         select suppliers);
          }
  
          public void AddSupplier(Supplier supplier) {
              Database.Suppliers.Add(supplier);
              Database.SaveChanges();
          }
  
          public void UpdateSupplier(Supplier supplier) {
              var tmpSupplier = Database.Suppliers.FirstOrDefault(s =&gt; s.SupplierID == supplier.SupplierID);
              tmpSupplier.SupplierName = supplier.SupplierName;
              tmpSupplier.SupplierAddress = supplier.SupplierAddress;
              Database.SaveChanges();
          }
  
          public void DelteSupplier(Supplier supplier) {
              Database.Suppliers.Remove(supplier);
              Database.SaveChanges();
          }
          #endregion
  
          #region Claim
          public IQueryable&lt;Claim&gt; GetAllClaims() {
              return Database.Claims;
          }
  
          public Claim GetClaimByID (int id) {
              return Database.Claims.FirstOrDefault(c =&gt; c.ClaimID == id);
          }
  
          public void AddClaim(Claim claim) {
              Database.Claims.Add(claim);
              Database.SaveChanges();
          }
          public void UpdateClaim(Claim claim) {
              var tmpClaim = Database.Claims.FirstOrDefault(c =&gt; c.ClaimID == claim.ClaimID);
              tmpClaim.ClaimTotal = claim.ClaimTotal;
              tmpClaim.ClaimWIP = claim.ClaimWIP;
              tmpClaim.FK_ClientID = claim.FK_ClientID;
              tmpClaim.FK_SupplierID = claim.FK_SupplierID;
              Database.SaveChanges();
          }
          public void DeleteClaim(Claim claim) {
              Database.Claims.Remove(claim);
              Database.SaveChanges();
          }
          #endregion
      }
  }
  </code></pre>
  
  <p>Can someone please help me understand this error and also help my fix it please. Thank you.</p>