dotnethao wrote:
There is only sample code about EntityCollection containertype.
I select the DataContainerType and the type of object, but i can not see any result while running. How to implement performSelect and PerformGetDbCount? can you give me sample code about those implemention?
T
Thanks.
PerformSelect eventhandlers typically fetch data like you would do it normally, with the exception that all objects needed for the fetch are already provided to you by the eventargs passed in: predicates, typedlist object and other objects you might need in the fetch.
So when you want to fetch a typedlist in a PerformSelect eventhandler, you do:
protected void LLBLGenProDataSource1_PerformSelect(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformSelectEventArgs e)
{
e.ContainedTypedList.Fill(e.MaxNumberOfItemsToReturn, e.Sorter, e.AllowDuplicates, e.Filter, null, e.GroupBy);
}
I did made a mistake in the PerformGetDbCountEventArgs object though:
. There's no property for the contained TypedList/TypedView object. This is a clear oversight, likely caused by the fact that the scenario to use non-live persistence for typedlists/views isn't that common, as they're readonly anyway, but these properties will be added a.s.a.p. Sorry for that. A workaround for that is to read the TypedList object directly from the datasource object:
protected void LLBLGenProDataSource1_PerformGetDbCount(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformGetDbCountEventArgs e)
{
LLBLGenProDataSource1.TypedList.GetDbCount(e.AllowDuplicates, e.Filter, e.Relations, e.GroupBy);
}