I've implemented a content management system that deals with a certain kind of object, and now the client has introduced another kind of object, whose structure and behavior is exactly the same, but separate. They want to be able to switch modes, where each mode behaves identically, except that one deals with one object type and the other with the other.
Suppose the first object type is stored in a table called TBL_OBJECT, and the second in one called TBL_OBJECT_NEW. I'm looking for a way to use my existing code, but to be able to switch on the fly and have it switch to the other table. Because the structure is identical, this is conceptually possible. The only problem is that in L2E, the table name is saved as attribute and compiled in, so I'm looking for a way to hook the sql statement creation process, so that my existing statements like this:
Dim db as New DataContext
Dim query = From obj in db.Objects
will resolve to the TBL_OBJECT_NEW table instead of the TBL_OBJECT table. If I can do this, I can reuse a huge amount of code. I know it's a somewhat unusual scenario, but I'm really hoping it's possible. Any help much appreciated! Thanks.
By the way, I'm using LinqConnect from DevArt for this; I don't know how much a plain L2E approach will apply to this. On the other hand, if you know how to do it with DevArt but NOT L2E, that would still be very helpful.