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

Reduce Constructor Injections #15395

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Reduce Constructor Injections #15395

merged 2 commits into from
Feb 27, 2024

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented Feb 24, 2024

@sebastienros I usually avoid using FromServices or manually try to resolve resources from the IServiceCollection. But I think in a busy controller like AdminController in the contents module, I think using FromServices make sense here we as we know that these service will always be registered at this point.

Went down from injecting 12 service down to 9 on every request to the AdminController.

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

@agriffard agriffard changed the title Reduce Constructur Injections Reduce Constructor Injections Feb 27, 2024
@MikeAlhayek MikeAlhayek merged commit 3551a62 into main Feb 27, 2024
5 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/di branch February 27, 2024 23:28
urbanit pushed a commit to urbanit/OrchardCore that referenced this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant