Basically, I'm using an ORM (specifically LLBLGen) that creates entity objects for all my tables. All these entity types inherit from a base class (or really a set of them). I want to create an extension method that accepts a List of the base class and returns some string but I want to pass in inherited types without explicitly casting.
For instance, I have a function like:
string GetString(List<EntityBase2> list); // also tried List<IEntityCore>, which the base class implements
And I want to pass it something like this:
List<ProductEntity> products = ... // populate it
string v = GetString(products);
But I get compiler errors.
How can I accomplish creating this helper method. I want to avoid casting if I can but if this is the best way then at least I could would have some confirmation on that.