title: System.AggregateException: 'Some services are not able to be constructed' In my ASP.net core
body: <p>I have a model:</p>
  <pre><code>public class Checkout
  {
      public string CheckoutId { get; set; }
  
      public List&lt;CheckoutItem&gt; CheckoutItems { get; set; }
  
  }
  </code></pre>
  <p>And I am trying to add methods to the Object while respecting POCOs. So I added A repository:</p>
  <pre><code>    public class CheckoutRepository : ICheckoutRepository
      {
          private readonly AppDbContext _appDbContext;
          private readonly Checkout _checkout;
  
          public CheckoutRepository(AppDbContext appDbContext, Checkout checkout)
          {
              _appDbContext = appDbContext;
              _checkout = checkout;
  
          }
  
          public void AddItem(unitItem item, int amount)
          {
                //Removed for brevity 
          }
  
          public void ClearCheckout()
          {
             //Details removed for brevity
          }
  
          public Checkout GetCart(IServiceProvider serviceProvider)
          {   
            //Details removed for brevity
          }
  
          public List&lt;CheckoutItem&gt; GetCheckoutItems()
          {
              //Details removed for brevity
          }
  
          public decimal GetCheckoutTotal()
          {
             //Details removed for brevity
          }
  
          public decimal RemoveItem(unitItem item)
          {
             //Details removed for brevity
          }
  </code></pre>
  <p>And an interface to the Repository</p>
  <pre><code>public interface ICheckoutRepository
      {
           Checkout GetCart(IServiceProvider serviceProvider);
  
          void AddItem(unitItem item, int amount);
  
          decimal RemoveItem(unitItem item);
  
          List&lt;CheckoutItem&gt; GetCheckoutItems();
  
          void ClearCheckout();
  
          decimal GetCheckoutTotal();
      }
  </code></pre>
  <p>I, of course, add this to the startup file.</p>
  <p><code>services.AddTransient&lt;ICheckoutRepository, CheckoutRepository&gt;();</code></p>
  <p>But when I run the application I get the error</p>
  <blockquote>
  <p>System.AggregateException: 'Some services are not able to be
  constructed'</p>
  </blockquote>
  <p>And 2 inner exceptions</p>
  <p>1:</p>
  <blockquote>
  <p>InvalidOperationException: Error while validating the service
  descriptor 'ServiceType: BataCMS.Data.Interfaces.ICheckoutRepository
  Lifetime: Transient ImplementationType:
  BataCMS.Data.Repositories.CheckoutRepository': Unable to resolve
  service for type 'BataCMS.Data.Models.Checkout' while attempting to
  activate 'BataCMS.Data.Repositories.CheckoutRepository'.</p>
  </blockquote>
  <p>And 2:</p>
  <blockquote>
  <p>InvalidOperationException: Unable to resolve service for type
  'BataCMS.Data.Models.Checkout' while attempting to activate
  'BataCMS.Data.Repositories.CheckoutRepository'</p>
  </blockquote>
  <p>Could really use some insight into this problem.</p>