I have a number of entity objects that are structurally the same but the naming convention is different e.g Products1, Products2, Products3 (this is part of the legacy db schema and I can't do much about this).
These classes are of different types as far as CLR is concerned and unfortunately since the design code is auto-generated I can't slap an interface on these guys to show commonality. So, my question is: Is there a way to retrieve the entity object by name?
I'd basically like to avoid switch/case business when applying essentially the same logic to these objects.
Depending on how many classes we're talking about, and how flexible you need to be, interfaces might not be out of the question. I've done something similar using generics:
So basically, you set up a separate file where you put the interface and a bunch of those little partial class declarations. Then you'll have access to the common structure. I don't know what your exact situation is, but this worked like a charm for me.