I need some help with my C# application.
Nowadays it works fine but one of the new requirements from customer is to implement underlying Database (MS SQL or Oracle) using any user schema selectable before program starts.
Inside of my application there are around 150 DataCommand objects.
So I need to catch every SQL expression inside of my application before it is executed and change target object(s) location. For example to change:
SELECT APPLICATION_NAME FROM **MY_SCHEMA**.APPLICATIONS
to
SELECT APPLICATION_NAME FROM **NEW_SCHEMA**.APPLICATIONS
As I see the solution of this problem - is to inject some code into every IDbCommand inside of my application, but can't imagine the point of start.
Any suggestions please.