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 IWebHostEnvironment
through the constructor of the HttpRequestInterceptor
and perform your IsDevelopment
check on that injected instance.