title: Dependency Injection: cannot convert from 'Service' to 'System.Type'
body: <p>I'm trying to add a scope in the Startup Class but for some reasons I get this error.</p>
  <blockquote>
  <p>cannot convert from 'service' to 'System.Type'</p>
  <p>cannot convert from 'Iservice' to 'System.Type'</p>
  </blockquote>
  <p>I've also checked if I've injected the service correctly in all the other classes.</p>
  <p>Here's the code</p>
  <pre><code>public class Startup
  {
      private readonly IService Iservice;
      private readonly Service service;
  
      public Startup(IConfiguration configuration, IService Iservice, Service service)
      {
          Configuration = configuration;
          this.Iservice = Iservice;
          this.service = service;
      }
  
      public IConfiguration Configuration { get; }
  
      // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)
      {
          services.Configure&lt;CookiePolicyOptions&gt;(options =&gt;
          {
              // This lambda determines whether user consent for non-essential cookies is needed for a given request.
              options.CheckConsentNeeded = context =&gt; true;
              options.MinimumSameSitePolicy = SameSiteMode.None;
          });
  
          services.AddDbContext&lt;DbContext&gt;(options =&gt;
          options.UseSqlServer(Configuration.GetConnectionString(&quot;Connectionstring&quot;)));
  
          services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
  
         // This is where I get the error
          services.AddScoped(Iservice, service);
      }
  </code></pre>
  <p>This seems like a beginner question so I'm sorry if it is.</p>