We are facing the following challenge.
We have an application - lets call it WebAPI. WebAPI interacts with a 3rd party database (lets call it TDB) via its own set of dlls - lets call them TDBLogic.dll, TDBServices.dll, TDBBusiness.dll. These dlls are all at version 1.2 and have been included as references in the WebAPI solution. The WebAPI solution has specific classes which interact with these dlls and perform the necessary operations. The TDB interactions are quite complex and we have some objects (lets call one TDBRepo) which inherit from interfaces from the TDB dlls.
The challenge is that we have environments with multiple TDB databases and each one running on a different version. If we wanted WebAPI to interact with the different TDB databases it would have to invoke the TDB dll's of the correct version. Furthermore as mentioned above the TDBRepo that interacts with these dll's would have to be different based on the version of the TDB dll that its using.
Thats a simplified version of our current problem, there is a lot more going on, but I am trying to find the correct approach to handling this in its simplest form.
I initially thought to just create multiple versions of our class that calls the TDB dlls including the TDBRepo for each version and then reference the relevant Dlls. The problem of course is that the dll's (TDBBusiness, TDBLogic and TDBServices) have the same name across each version.
I would really appreciate it if someone could suggest an approach to handling this correctly in a .net c# solution.
Is there a way to create the relevant TDBRepo class that references a specific version of these dlls?
The version switching would have to happen at runtime during the use of WebAPI and not just at LOAD time.
Thanks for the help!