Mapping stored procedure results to Entity classes

Posts   
 
    
benfidge
User
Posts: 2
Joined: 28-Feb-2007
# Posted on: 28-Feb-2007 15:35:27   

Hi

I'm fairly new to LLBLGen and am having trouble mapping the results of a stored procedure call to one of my Entity classes

I have a table called Member and a stored procedure called prcMember_GetActive which simply returns the results of the following query:

select * from Member where IsActive = 1

This is a very straight forward mapping between the Member table and the generated MemberEntity class. The generated RetrievalProcedures.prcMember_GetActive function only returns a DataTable but i'd like to retrieve a MemberCollection instance.

I've looked at projections but this seems a hell of a lot of work, especially if we're dealing with a large table.

Am I missing something obvious. I'd have thought it would be relatively easy for the code-generator to see the output of the stored procedure and map it to the approriate Entity class

Many thanks

Ben

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 28-Feb-2007 16:45:49   

select * from Member where IsActive = 1

That's a very easy query, I'd recommend not to use the SP. Just use the MemberCollection with a simple filter.