1

I have two services defined as per below.

services.AddSingleton<Request>();
services.AddScoped<NewService>();

Now in Request.cs file I want to inject object of NewService class so I do in this way.

private NewService _service;

public Request(NewService service)
        {
            _service = service;
        }

But getting this error : Some services are not able to be constructed (Error while validating the service descriptor 

I see that both service injected with different methods, one is with Singleton and one is with Scoped..

So now what to do to get this error solved.

Any idea on this.

Thanks

Sami In
  • 246
  • 2
  • 11

0 Answers0