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

Configuration abstraction, centralization, grouping #404

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Mates1500
Copy link
Contributor

The way config key strings and defaults were hamfisted (and sometimes repeated) all over the codebase didn't seem very elegant to me, so I've abstracted it into a couple of interfaces and moved all the parsing/implementation business into the MiNET.Console assembly.

I've also grouped it into logical blocks for better readability and usability.

- Now it's way easier to see the config defaults, usages all in one place
- Eliminated a bunch of repeated code
- All config properties are easily accessible from the debugger
- Config properties are defined in contracts/interfaces
@Mates1500
Copy link
Contributor Author

The old custom way of parsing has been removed (aside from the default value interpretation, which must stay) completely and replaced by the new .NET Core ConfigurationBuilder.
Therefore now we can add/switch stuff at will in MiNET.Console.Startup.BuildConfiguration(), like adding environment variables, command line arguments and such, see https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.iconfigurationbuilder?view=aspnetcore-2.1.

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

Successfully merging this pull request may close these issues.

2 participants