In Program.cs I can use
app.Environment.IsDevelopment()
Now I have a custom HttpRequestInterceptor : DefaultHttpRequestInterceptor with a method
public override ValueTask OnCreateAsync(HttpContext context,
IRequestExecutor requestExecutor, IQueryRequestBuilder requestBuilder,
CancellationToken cancellationToken)
How can I get access to app.Environment.IsDevelopment() in that method? (I want to set some kind of faked authentication during development)
You can inject the
IWebHostEnvironmentthrough the constructor of theHttpRequestInterceptorand perform yourIsDevelopmentcheck on that injected instance.