title: Error CS0308 The non-generic method 'ICollection<ServiceDescriptor>.Add(ServiceDescriptor)' cannot be used with type arguments in my Startup.cs
body: <p>Recently I am working on with SqlKATA Query Builder. I followed steps stated in <a href="https://sqlkata.com/docs/execution/setup" rel="nofollow noreferrer">here</a>. After solving some errors, when there was no red underline situation in my code, I ran my solution. Then I received error CS0308. When I tried to troubleshoot my solution, I commented a section from Startup.cs where I locate it in ConfigureServices method:</p>
  
  <p><code>services.Add&lt;QueryFactory&gt;(() =&gt; { 
  var connection = new SqlConnection( "Data Source=serverName\serverInstance;Initial Catalog=databaseName;Integrated Security=True");
  var compiler = new SqlServerCompiler();
  return new QueryFactory(connection, compiler);
  });</code></p>
  
  <p>After that, it ran smoothly with a displayed text I set. But when I uncommented the section, it showed me the error again.</p>
  
  <p>Any ideas why? Any help would be much appreciated!
  <strong>EDITED:</strong> 
  <code>var connection = new SqlConnection( "Data Source=serverName\\serverInstance;Initial Catalog=databaseName;Integrated Security=True");</code></p>