You can inject dependencies using IApplicationBuilder instance in this way
public void Configure(IApplicationBuilder app) { //---------- Your code using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope()) { var resultLogic = serviceScope.ServiceProvider.GetService<IResultLogic>(); resultLogic.YourMethod(); } //---------- Your code }