Hi,
We're building a generic framework around LLBLGen, which means we can't use the actual entities in the framework but only Interfaces and BaseClasses. All in selfservicing.
Today we've tried to do GetScalar methods in this way. We need this to get a row count on a table (very big one, collection.getmulti(null).count is not an option).
The process:
Initialize a [EntityName]DAO using Activator.CreateInstance(type) out of the .dll file (which is specified in the web.config) of the dataproject class and cast it as a IDao.
Then we run the IDao.GetScalar() and retrieve the result as an int:
// Get the resultset with paging
this.entityCollection.GetMulti(null, -1, null, null, null, this.PagingCurrentPage, this.PagingPageSize);
// Get the dao class via our framework activator system
IDao dao = Dionysos.DataFactory.EntityFactory.GetDao(this.EntityName) as IDao;
// Now getsclar to get rowcount
if(this.entityCollection.Count > 0)
{
dao.GetScalar(this.entityCollection[0].Fields, null, null, null, null);
}
We do get an int as result, but it's not equal to: this.entityCollection.getmulti(null).count, the int returned by the scalar is different of that of the .count
I've got the idea i'm freestyling to far now and think I know what I am doing, but actually I am probably not. Who takes the very nice position of putting me back on my feet and tell me what I am doing completly wrong. If not so wrong, please tell me what I am missing.
Thanks a lot!