Retrival procedure result to unknown entitycollection but ....

Posts   
 
    
Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 06-Mar-2015 08:43:13   

I like to create an entitycollection of "unknown" entitytype, the resultset of a retrival procedure call.

The resultset of the stored procedure is assigned to a dataset. Because the result of the stored procedure is that of a pivot on a dynamic list of entities, we can't decide in forehand what the entitytype is. That means we need to create the entitytype dynamically.

Is this possible and how?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 06-Mar-2015 10:48:53   

By Dynamically you mean the type will be decided upon the data being retrieved, or before retrieval?

If the type is determined before retrieval then your code could generically use projection

Otherwise, you will need to create the collection dynamically based on the returned data, and manually do the import from the returned dataTable/dataReader.