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

Fluent config should load values into AppSettings dictionary #973

Closed
rockfordlhotka opened this issue Nov 8, 2018 · 2 comments
Closed
Assignees

Comments

@rockfordlhotka
Copy link
Member

Having implemented the basic fluent config API functionality, and on further review, I think it would be a far simpler and better implementation to have the fluent config methods load values into the Csla.Configuration.ConfigurationManager.AppSettings dictionary.

The current implementation sometimes does that, and sometimes sets values directly on the ApplicationContext or other types within the CSLA object model.

Not only is that inconsistent, but I think it adds ambiguity to the behavior. It isn't clear that the fluent API overwrites/overrides config file values (it should). I strongly suspect that, over time, I'd come to regret having this weird dual model for setting config values at runtime.

Add to that, the work item to load values from the .NET Core config subsystem (#967), which also needs a way to map a new config system into the existing config model, and things could get unbearably complex.

If I change the fluent API to load AppSettings, and the .NET Core config approach also loads AppSettings, then we have a unified and consistent scheme for loading config values as the app starts up, regardless of which of the three config models is used.

@rockfordlhotka
Copy link
Member Author

Some properties in ApplicationContext don't have settings entries in AppSettings:

  • UseReflectionFallback
  • RuleSet
  • DataPortal ProxyDescriptors

These will continue to directly set the values in memory.

For ease of use I also left DataPortal().Activator and added DataPortal().ActivatorType.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant