Skip to content

Add GetDataPortal<T>() function publicly to ApplicationContext #2733

Discussion options

You must be logged in to vote

I think I'd rather add something like a DataPortalFactory concept.

ApplicationContext already violates the single responsibility pattern, and I hesitate to keep adding functionality that makes it worse in that regard.

However, the need to inject numerous data portal instances is not unique to your scenario. It is also (I'm finding) quite common in data portal operation methods where a root class is responsible for loading a lot of child types, or in a command object that interacts with numerous business types.

Being able to inject an IDataPortalFactory that is then used to get the various data portal instances might be a good solution.

Issue #2676 is tracking this idea - I added some more…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mtavares628
Comment options

mtavares628 Jan 31, 2022
Collaborator Author

@rockfordlhotka
Comment options

Answer selected by mtavares628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants