Trying to create a new module and trying to figure out the best practice for configuring the module from appsettings values.
I have read this link. https://aspnetboilerplate.com/Pages/Documents/Startup-Configuration. I have setup my module like that but can't figure out where to initialize the configuration values. Should I put my dependson in the core module? If so, I don't have the appsettings there.
Should I put the dependson in the webcore module? The problem is the order is off since the PreInitialize of my custom module gets called first.
Or finally, should the dependson go in the webhost module?
This custom module is to introduce Elasticsearch into the project. I will need to fire a create index on startup so I need the configuration values.
Thanks
1 Answer(s)
-
0
Hi @[email protected],
You can get the configuration values from the appsettings webhost by putting a dependon there.
[DependsOn( typeof(MyAppHostModule), typeof(MyCustomHostModule) )]