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

Add fluent config types to CSLA #966

Closed
rockfordlhotka opened this issue Nov 4, 2018 · 8 comments
Closed

Add fluent config types to CSLA #966

rockfordlhotka opened this issue Nov 4, 2018 · 8 comments
Assignees

Comments

@rockfordlhotka
Copy link
Member

rockfordlhotka commented Nov 4, 2018

It would be easier to configure CSLA if we had a set of fluent configuration types in Csla.Configuration, following the model of config types used in ASP.NET Core and other scenarios.

Something like

    Csla.Configuration.ConfigureCsla()
        .DefaultDataPortalProxy("proxyTypeName", "serverUrl")
        .Authentication("Windows")
        .SerializationFormatter("MobileFormatter")
@rockfordlhotka rockfordlhotka self-assigned this Nov 4, 2018
@rockfordlhotka rockfordlhotka added this to To do in Version 4.9.0 via automation Nov 4, 2018
@rockfordlhotka
Copy link
Member Author

Also add an extension method for ASP.NET Core as per this doc.

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.1

@itgoran
Copy link
Member

itgoran commented Nov 4, 2018

@rockfordlhotka
Should CSLA have his own configuration section in the appsettings.json file for this and further configurations?

Example (just a few of them):

{
   "csla": {
      "proxyType":"name",
      "authentication":"windows",
      "serializationFormatter":"MobileFormatter"
    }
}

Beside fluent interface, existing configuration mechanism implemented in the .net core can be used.

@rockfordlhotka
Copy link
Member Author

Yes, it should.

A couple versions ago I switched everything inside the framework to use Csla.Configuration instead of System.Configuration to decouple from the .NET Framework.

So if you are running on .NET Framework then you get the legacy behavior from app.config/web.config unchanged.

I didn't implement any of the new behaviors from .NET Core, as I didn't have time - but that should absolutely happen!

Not just for appsettings.json, but the higher level abstractions, because .NET Core's config subsystem is smart enough to pull from ENV variables or other locations common in cloud scenarios (where config files are a bad idea in general).

@rockfordlhotka
Copy link
Member Author

@itgoran - interested in helping?

@itgoran
Copy link
Member

itgoran commented Nov 4, 2018

@rockfordlhotka
I would like to help.

@rockfordlhotka
Copy link
Member Author

@itgoran wonderful! The next steps are

  1. I created Read CSLA config values from .NET Core config subsystem #967, a new work item for the .NET Core config subsystem integration as I think it is related to, but not the same as, this fluent config enhancement
  2. We need to figure out how this'll work - ideally abstracted within Csla.Configuration and ApplicationContext in a nice way - we can discuss in the other issue thread
  3. I need you to review CONTRIBUTING.MD and send me a contributor agreement
  4. If you haven't done GitHub open source work, you may want to review my GitHub workflow blog post

@rockfordlhotka rockfordlhotka moved this from To do to In progress in Version 4.9.0 Nov 5, 2018
@rockfordlhotka rockfordlhotka moved this from In progress to To do in Version 4.9.0 Nov 5, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 5, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 5, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 5, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 5, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 5, 2018
Version 4.9.0 automation moved this from To do to Done Nov 5, 2018
@rockfordlhotka rockfordlhotka moved this from Done to In progress in Version 4.9.0 Nov 5, 2018
@rockfordlhotka rockfordlhotka reopened this Nov 5, 2018
Version 4.9.0 automation moved this from In progress to Done Nov 5, 2018
@rockfordlhotka rockfordlhotka moved this from Done to In progress in Version 4.9.0 Nov 5, 2018
@rockfordlhotka rockfordlhotka reopened this Nov 5, 2018
@rockfordlhotka
Copy link
Member Author

Need to clean up some of the method names, especially in the CslaDataPortalConfiguration type, as the names seem messy.

Also, the configuration sub-types for data/dataportal/security/serialization should be attached to the base config type by extension methods, not as explicit methods. Using extension methods allows other/future subareas of CSLA to add themselves to the fluent config API.

rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 6, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 6, 2018
Version 4.9.0 automation moved this from In progress to Done Nov 6, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 9, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 9, 2018
rockfordlhotka added a commit to rockfordlhotka/csla that referenced this issue Nov 9, 2018
itgoran pushed a commit to itgoran/csla that referenced this issue Nov 21, 2018
itgoran pushed a commit to itgoran/csla that referenced this issue Nov 21, 2018
itgoran pushed a commit to itgoran/csla that referenced this issue Nov 21, 2018
rockfordlhotka pushed a commit that referenced this issue Nov 21, 2018
Closes #967 

* #967 Load configuration from appsettings.json

Load configuration for csla using 'csla' section from appsettings.json file.
Add tests for testing configurations.

* #967 Reset global conf after tests

* Update to reflect v4.9 projects and directives

* Update CompilerDirectives.md

* #961 Move implementation of Dashboard to new branch (old branch was based on wrong base)

* #961 Fix configuration reset issues with cached dashboard object

* #966 CslaConfiguration methods need to return ICslaConfiguration

* #961 Maintain timer state on a per-request basis via ClientContext

* #966 Add missing using statements

* #966 Fix issues where not all settings were being reset properly

* Refine the tests excluded from Live Testing

* Fix incorrect namespace

* Fix name conflict

* #961 Implement IDisposable and properly dispose of timers

* #961 Change tests to use async Task and Task.Delay

* #961 Change timer settings

* #961 Ignore tests that pass except on Appveyor

* Update to reflect v4.9 projects and directives

* #993 Implement SaveAndMergeAsync methods

* #995 Add DefaultProxy overload to allow Type to be passed

* #967 Configurations are written into AppSettings

All configurations are written into ConfigurationManager.AppSettings
Add clean context before and after tests
@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
No open projects
Version 4.9.0
  
Done
Development

No branches or pull requests

2 participants