Replies: 6 comments
-
Please see code for that information. Start up is here: https://github.com/Dotnet-Boxed/Templates/blob/master/Source/ApiTemplate/Source/ApiTemplate/Startup.cs We take the "early initialization" approach as seen here https://github.com/serilog/serilog-aspnetcore/blob/dev/samples/EarlyInitializationSample/Program.cs |
Beta Was this translation helpful? Give feedback.
-
Thanks, but I don't understand with class you built to read appsettings into a controller. |
Beta Was this translation helpful? Give feedback.
-
That is done here https://github.com/Dotnet-Boxed/Templates/blob/master/Source/ApiTemplate/Source/ApiTemplate/CustomServiceCollectionExtensions.cs#L93 |
Beta Was this translation helpful? Give feedback.
-
I create ConnectionString class like CompressionOption class, but point to new part into appsetting.json and I put it into this
After I made mapping
I'm able to read config into the controller,
Now, I wish to read IConfiguration from internal class and not a controller. SerialNumberRepo declaration:
PS: and the logger? |
Beta Was this translation helpful? Give feedback.
-
What does ConnectionStringsOptions look like? And what does your appsettings and appsettings.Development look like? Make sure to redact any secrets. |
Beta Was this translation helpful? Give feedback.
-
That is? |
Beta Was this translation helpful? Give feedback.
-
Question
Have you injected IConfiguration configuration, ILogger logger into startup and so usable into controllers api or class?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions