My problem is this:
- I need to call two different services with similar API through HTTP. Lets say I derived IBaseService with two methods - MakeOrder and CancelOrder.
- Service I want to call is determined by request I receive - It contains serviceToCall attribute.
- I use Asp.NET core basic dependency container and want to have nice code - some workaround'd be easy thought.
The thing is that I got lost in all the patterns and approaches I can choose (besides DI Factory method or Strategy came to my mind).
Could you guys give me a hint how to solve the isue? I bet there is a way how to do it without if statement in every method.
Aucun commentaire:
Enregistrer un commentaire