I have an interface that I put on certain generated entities in my project.
I'd like to create a class that takes in its ctor an EntityCollection that is constrained to types that implement that interface. Is that possible?
(EDIT) I should have been more clear--the fact that it's a ctor really has nothing to do with it. I would just like to able to constrain the EntityCollection to types that implement that interface.
When I try:
public ImportMapper(EntityCollection<IMyInterface> temp)
{
_coreAttributes = coreAttributes;
_dynamicAttributes = dynamicAttributes;
_batchId = batchId;
_siteId = siteId;
}
I get:
Error 2 The type 'Flex.DAL.Custom.Interface.IMyInterface' must be convertible to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2' in order to use it as parameter 'TEntity' in the generic type or method 'Flex.DAL.HelperClasses.EntityCollection<TEntity>'
Thanks for any insight.
Phil