Search code examples
asp.netbit-framework

access to IApplicationBuilder using Bit Framework


I am using bit framework in my project, I want to add UseHttpsRedirection as a middleware in appstartup.cs, how can i do this using bit framework?


Solution

  • try to use this code:

     dependencyManager.RegisterAspNetCoreMiddlewareUsing(aspNetCoreApp =>
                {
                    AppEnvironment env = DefaultAppEnvironmentsProvider.Current.GetActiveAppEnvironment();
                    if (!env.DebugMode)
                        aspNetCoreApp.UseHttpsRedirection();
    
                });