EntityCollection<IEntity2> not valid?

Posts   
 
    
jds4peace
User
Posts: 12
Joined: 16-Nov-2006
# Posted on: 21-Sep-2007 17:27:54   

I'm trying to do:


public abstract EntityCollection<IEntity2> AnyEntities
{
      get;
}


public override EntityCollection<IEntity2> AnyEntities
{
   get
   {
         //TODO:get a real collection
         return new EntityCollection<SomeEntity>();
    }
}


When compiling I get:

The type 'SD.LLBLGen.Pro.ORMSupportClasses.IEntity2' must be convertible to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2' in order to use it as parameter 'TEntity' in the generic type or method 'PSLlblGen.HelperClasses.EntityCollection<TEntity>'

I just need a way to return a collection that could possibly contain any entity. Am I going about this the wrong way? I've tried:


pubic abstract EntityCollection<EntityBas2>...

as well and while this compiles in the abstract class in the implementing class I get:

Cannot implicitly convert type 'PSLlblGen.HelperClasses.EntityCollection<PSLlblGen.EntityClasses.SomeEntity>' to 'PSLlblGen.HelperClasses.EntityCollection<SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2>'

Any help would be appreciated.

~JDS

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Sep-2007 20:03:08   

Try the following:

public abstract IEntityCollection2 AnyEntities
{
     get;
}


public override IEntityCollection2 AnyEntities
{
get
{
         //TODO:get a real collection
         return new EntityCollection<SomeEntity>();
    }
}