First off I am using LLBLGen version 2.0 December 6, 2006 for .NET 2.0.
In my application there is a base form that we have written that all our other forms inherit that takes care of alot of base functionality.
Previously, our application was using collection classes that were written by us and we are porting our application over to use LLBLGen. In this base form we use a base Collection obect (also written by us). All of our collections inherit this base collection, similar to LLBLGen classes except they we're not using Generics.
The reason for this form is so that when I want to make a form to deal with a certain collection, I would not have to rewrite this functionality over and over again
Lets say I want to make a form to display a bunch of customers. My inheriting form would use a CustomerEntityCollection where as my base form would not reference this specific collection because it is different for all inheriting forms.
I'm trying to make this work with LLBLGen with no success so far, possibly due to my limited knowledge of generics.
In my base form, I have a method that needs to reference a base collection type because it can't know about any inheriting collections. My method is used to fill a dropdown lets say.
In the base form I declare it as:
protected void FillDropDown(TtgDropDownControl dropDown, EntityCollectionBase<EntityBase> collection)
{...
}
In my inheriting form, I do the following:
CustomerEntityCollection customers = new CustomerEntityCollection();
customers.GetMulti(null);
FillDropDown(dropDown, customers);
I get the Error: Cannot implicitly convert type 'DataAccess.CollectionClasses.CustomerEntityCollection' to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase<SD.LLBLGen.Pro.ORMSupportClasses.EntityBase>'
This is the way we were doing it with our previous collection classes but again they were not using generics.
I see that the EntityCollection classes inherit EntityCollectionBase<Entity>, and Entity inherits EntityBase, so I figured this would work. Any help is appreciated.
Thanks,
Milos