Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add access to webhostenvironment #327

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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