title: A suitable constructor for type 'RestDataService' could not be located
body: <p>While running the .Net Core 2.0 API endpoint getting below error.</p>
  
  <p>A suitable constructor for type 'RestDataService' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.</p>
  
  <pre><code> public partial class RestDataService : IRestDataService
      {
          private static HttpClient _client;
          private static AppConfiguration _configuration;
          private const short MaxRetryAttempts = 3;
          private const short TimeSpanToWait = 2;
  
          public RestDataService(AppConfiguration configuration)
          {
              _client = configuration.HttpClient;
              _configuration = configuration;
          }
  ........
  </code></pre>
  
  <p>And my startup class is something like this :</p>
  
  <pre><code>  // This method gets called by the runtime. Use this method to add services to the container.
          public void ConfigureServices(IServiceCollection services)
          {
  
              var config = new AppConfiguration
              {
                  Environment = Configuration["environment"],
              };
  
              services.AddMvc().AddJsonOptions(o =&gt; o.SerializerSettings.NullValueHandling = NullValueHandling.Include);
              services.AddMemoryCache();
              services.AddCors();
              services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
                  services.AddSingleton(Configuration);
                  services.AddSingleton(config);
              services.AddLogging();
              services.AddTransient&lt;IRestDataService, RestDataService&gt;();
  
  services.AddHttpClient&lt;IRestDataService, RestDataService&gt;()
                  .AddPolicyHandler(request =&gt; request.Method == HttpMethod.Get ? retryPolicy : noOp);
  
  </code></pre>
  
  <p>Any suggestions, to get rid of this? constructor is already public and all the parameters are registered in startup file</p>