Basically, I use ORM (specifically LLBLGen), which creates entity objects for all my tables. All these types of objects are inherited from the base class (or indeed their set). I want to create an extension method that takes a list of the base class and returns some string, but I want to pass the inherited types without an explicit cast.
For example, I have a function like:
string GetString(List<EntityBase2> list);
And I want to give him something like this:
List<ProductEntity> products = ...
string v = GetString(products);
But I get compiler errors.
How can I create this helper method. I want to avoid casting if I can, but if this is the best way, at least I could get some confirmation.