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

asResolutionRoot does not affect validation #578

Closed
Metadorius opened this issue May 26, 2023 · 3 comments
Closed

asResolutionRoot does not affect validation #578

Metadorius opened this issue May 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Metadorius
Copy link
Contributor

Metadorius commented May 26, 2023

            container.Register(
                Made.Of(_ => ServiceInfo.Of</*ILoggerFactory*/_SerilogLoggerFactory>(),
                    f => f.CreateLogger(Arg.Index<Type>(0)),
                    r => r.Parent.ImplementationType),
                setup: Setup.With(condition: r => r.Parent.ImplementationType != null,
                    asResolutionRoot: false));

Currently this does not affect validation whatsoever because there's no exclusion of AsResolutionRoot == true services in the Validate, which is counterintuitive.

Originally posted by @Metadorius in #577 (comment)

One option would be amending the default validation condition which would probably make more sense in general conditions (usually there's not many resolution roots) but would break the default behavior: #577 (comment)

Another option is:

I would rather filter all registrations based on the IsResolutionRoot, then if nothing found fallback to the current behavior.

Originally posted by @dadhi in #577 (comment)

@dadhi dadhi added this to the v5.4.1 milestone May 26, 2023
@dadhi dadhi added the bug Something isn't working label May 26, 2023
@dadhi dadhi self-assigned this May 26, 2023
@dadhi dadhi closed this as completed in 97ccab8 May 26, 2023
@Metadorius
Copy link
Contributor Author

Metadorius commented Jun 9, 2023

Hello! Been checking for a while, is there any ETA on the new version release with this and other recent fixes?

@dadhi
Copy link
Owner

dadhi commented Jun 10, 2023

@Metadorius No promises, but will try to release this weekend.

@dadhi
Copy link
Owner

dadhi commented Jun 10, 2023

@Metadorius Released right now, it might be some time until NuGet will index the 5.4.1 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants