Skip to content

Add access to webhostenvironment#327

Open
jkone27 wants to merge 3 commits intoSaturnFramework:mainfrom
jkone27:add-access-to-webhostenvironment
Open

Add access to webhostenvironment#327
jkone27 wants to merge 3 commits intoSaturnFramework:mainfrom
jkone27:add-access-to-webhostenvironment

Conversation

@jkone27
Copy link

@jkone27 jkone27 commented Dec 5, 2021

CEs element or other configuration parts requiring IWebHostEnvironment instances can have access to it, for example

 [<CustomOperationAttribute("custom_bootstrap")>]
    member this.CustomBootstrap (state : ApplicationState) =
        
        let service (services : IServiceCollection) =

            services.CustomBoostrap(
                ApplicationBuilder.WebHostEnvironment, //// <<< USED HERE
                (Config.getConfiguration(services)),
                fun opt ->
                    opt.ApplicationInformation.ApplicationName <- "Acme.WebApi.Template.ApplicationName"
                    opt.ApplicationInformation.ApplicationGroup <- "Acme.WebApi.Template.ApplicationGroup"
            )

        {  state with
            ServicesConfig = service::state.ServicesConfig
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant