Replies: 1 comment
-
@Ditriksss Hi there. You may use either registration Condition or the ScopedTo reuse. registrator.Register<IRepository, RepositoryA>(
setup: Setup.With(condition: req => req.Parent.Any(p => p.ServiceType == typeof(MainServiceA))));
registrator.Register<IRepository, RepositoryB>(
setup: Setup.With(condition: req => req.Parent.Any(p => p.ServiceType == typeof(MainServiceB)))); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I need to change implementation of interface in old project to use new approach. The problem is that I want to change every occurence of this interface only when specific service is used.
So in the following code I want to manipulate IRepository interface.
And Service which represent the functionality I want to use.
We have two main classes which can reflected input to this functionality
My question is how can I do that. To override implementation of IRepository in whole dependency tree only for one specific service.
Beta Was this translation helpful? Give feedback.
All reactions