Csla 6 fluent configuration - should there be a RegisterContextManager extension method? #2699
Unanswered
TheCakeMonster
asked this question in
Ideas
Replies: 1 comment 4 replies
-
I like the AddContextManager name - doesn't that fit better with what Microsoft does? In any case, this is a good suggestion for sure. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Csla contains cleverness to automatically select the right ApplicationContextManager for the environment within which it is running. This almost always just works, and doesn't need configuring. However, there are edge cases, and one of them is unit testing.
It is currently possible to specify a custom context manager by registering your own with DI, but you need to know to register it against the IContextManager interface for it to work.
We could add an extension method, probably to CslaOptions, to make this a bit more discoverable, so that it can be done via the AddCsla method
I suppose there is a chance that this could encourage people with limited knowledge to change it out and then raise support issues and questions about why something isn't working as intended. However, I think the easier discoverability of it is probably worth this potential cost of answering questions in the unlikely event that someone changes it incorrectly.
Beta Was this translation helpful? Give feedback.
All reactions