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

QUESTION: Checking types before adding to container #251

Closed
monkeydeus opened this issue Apr 4, 2025 · 2 comments
Closed

QUESTION: Checking types before adding to container #251

monkeydeus opened this issue Apr 4, 2025 · 2 comments

Comments

@monkeydeus
Copy link

I've got a requirement to add virtually all the types in an app to the container, so there is not much filtering of the classes in my scan. Some classes that are getting included cannot actually be instantiated by the container. So far its been attributes, and records.

I've been having difficulty coming up with a way to check that the type can be instantiated before adding it... is there a scrutor-approved way of doing this in a scenario like this?

@khellang
Copy link
Owner

khellang commented Apr 4, 2025

is there a scrutor-approved way of doing this in a scenario like this?

Hey @monkeydeus! 👋🏻 Not really. Trying to instantiate types at scan-time would be really expensive. You could maybe discover some issues by using ValidateOnBuild, but this should be on by default during development.

@monkeydeus
Copy link
Author

That is what I figured, but thanks for getting back quickly. I think I can narrow the scope of how I am using Scrutor instead, for now, and revisit this idea in a future rev.

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

No branches or pull requests

2 participants