can1 wrote:
I am just new to LLBLGen and trying to work out the details.
I am using the extended adapter templates. It appears that the adapter templates return generic EntityCollection objects, not strongly typed collections.
Why do the adapter templates not return strongly typed collections?
This is mainly because of the overhead in strongly typed collections. For example, if you create a subclass of an entity, say OrderWithTotal, the Orders collection in Customer has to change type, from OrderCollection to OrderWithTotalCollection. This is cumbersome if you work with strongly typed collections.
How are people using this for ASP.NET databinding? If you create a bound column in an asp.net datagrid, and set the 'Data Field:' property to FieldX, then bind the datagrid to the filled EntityCollection object, will the ASP.NET databind pick up the binding to FieldX, even though the collection is not strongly typed?
Yes. You can drag an EntityCollection onto a webform (.NET 1.x) and you'll get a popup which allows you to select the entityfactory to use, for example CustomerEntityfactory. Then you'll see all columns of a customer entity.
Inside EntityCollection, a routine exists which returns to .NET the properties of the object inside the collection. (through the .NET interface ITypedList)
Is there a way to easily cast or convert the weakly typed collection to a strongly typed collection, preserving all the IBindingList implementations in the LLBLGen EntityCollection object?
Only if you derive your strongly typed collection from EntityCollection AND you instantiate a strongly typed collection first, then pass that on to FetchEntityCollection for example, that will work, you can then cast up/downwards.
Are people finding this to be a serious problem with adapter templates? or is having a weakly typed collection not an issue? It just seems a little odd for such an incredible tool to return weakly typed collections, having to cast each individual object to the appropriate type before being able to work with it?
It doesn't seem to be a problem, in fact, it was a request from a lot of people to have a general entitycollection instead of a lot of strongly typed collections.
Are there plans for version 2.x to return strongly typed collections in the adapter scenario?
Yes, for .NET 2.0, a collection which uses generics is planned. Which is of course typed
Please don't take my questions in a negative manner. I think LLBLGen is awesome, just trying to figure out how to use it properly in my project.
No problem
Every feedback is good, and your questions are very reasonable. I hope I've clarified it a bit, if not, feel free to ask more