Fetching data as object array

Posts   
 
    
alexkor88
User
Posts: 8
Joined: 06-Apr-2022
# Posted on: 23-Dec-2022 07:58:11   

We can use DataAccessAdapter to fetch data from database, return data as Entity, DataTable or DTO

If CacheResultset enabled, we noticed cached data will store in CachedResultset's property called 'CachedRows' as object array

Is there any class or function we can use to fetch data as object array, instead of Entity, Datatable or DTO?

which this class or function can fetch data (as object array) from database or CachedResultset

We are using LLBLGen Pro version 5.8

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 23-Dec-2022 10:44:14   

Use queryspec and the .Select() method (which will create a DynamicQuery, not a DynamicQuery<T> which will return a list of object arrays. No idea why you'd want that tho , but you can using that. https://www.llblgen.com/Documentation/5.9/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/QuerySpec/gencode_queryspec_projections.htm#typed-projections

Frans Bouma | Lead developer LLBLGen Pro
alexkor88
User
Posts: 8
Joined: 06-Apr-2022
# Posted on: 28-Dec-2022 09:13:48   

Otis wrote:

Use queryspec and the .Select() method (which will create a DynamicQuery, not a DynamicQuery<T> which will return a list of object arrays. No idea why you'd want that tho , but you can using that. https://www.llblgen.com/Documentation/5.9/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/QuerySpec/gencode_queryspec_projections.htm#typed-projections

Thanks for your help, It works!

Due to some performance concern, we just tried to see if there is a way to fetch data as raw data format, instead of entity format, so we can compare the performance of each methods to fetch data

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 28-Dec-2022 09:40:08   

I already did that for you: https://github.com/FransBouma/RawDataAccessBencher/blob/master/Results/20221124_net6.txt See repo: https://github.com/FransBouma/RawDataAccessBencher

Please pay attention to the standard deviation value, it sometimes looks like something is slow but there was e.g. 1 or 2 fetches which were slower due to unclear circumstances, e.g. windows decided to do something all of a sudden and a slight delay occurred. You can run it locally btw.

The sets fetch 37,000 rows or thereabout (adventureworks, salesorderheader table) so as you can see, performance is pretty ok simple_smile

Frans Bouma | Lead developer LLBLGen Pro
alexkor88
User
Posts: 8
Joined: 06-Apr-2022
# Posted on: 28-Dec-2022 11:12:23   

Great! thanks for the information simple_smile