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

Register up to one implementation with marker interface #164

Open
Alan1616 opened this issue Feb 18, 2022 · 1 comment
Open

Register up to one implementation with marker interface #164

Alan1616 opened this issue Feb 18, 2022 · 1 comment

Comments

@Alan1616
Copy link

Alan1616 commented Feb 18, 2022

I want to do the following

 scan => scan
               .FromAssemblies(assembly)
               .AddClasses(classes => classes.AssignableTo<IScopedService>())
               .UsingRegistrationStrategy(RegistrationStrategy.Throw)
               .AsSelfWithInterfaces()
               .WithScopedLifetime()

But it would always throw as i have many IScopedService in my assembly. Let's say i have class A : InterfaceA, IScopedService and class B: InterfaceA, IScopedService only then it should throw.
Is this possible with scrutor?

@khellang
Copy link
Owner

Hi @Alan1616! 👋🏻

Sorry for the long response time! I'm not sure what your desired scenario is here. Do you want it to throw or not? 😅

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