Whiteknight / StoneFruit

Cli commandlet host and execution environment
https://whiteknight.github.io/StoneFruit/
Apache License 2.0
0 stars 0 forks source link

Don't overwrite existing DI registrations in Setup classes #1

Closed Whiteknight closed 3 years ago

Whiteknight commented 4 years ago

If we have existing registrations in the DI container, we shouldn't overwrite those or blindly ignore them in the EngineBuilder and other Setup classes. For example, if we have an IParser<string, IParsedArgument> already registered, the ParserSetup.BuildUp() method can detect that and do no further work.

Whiteknight commented 3 years ago

This is done now in v2, several methods .Add* have been replaced by .TryAdd* for setting up the DI, so those registrations will not overwrite registrations created by the user.