Providing Hints to Stored Procedure return Value

Posts   
 
    
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 06-Feb-2013 23:23:16   

Entity Framework 4.

I have a Stored Procedure which I can not alter.

It returns a simple int based on a simple "Select Count(*)..." SQL call but it is wrapped in a bunch of SQL If/else calls too so LLBL can't guess the return value.

Is there a way to give a hint to LLBL so that I can get a return value of an int .

Currently I have to do this:

            
var table=_dataContext.GetNumberOfReasonsToLoveLLBL(name);
            if (table != null && table.Rows.Count > 0)
                rowCount =(int) table.Rows[0][0];

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Feb-2013 07:28:44   

If you can't alter the SP, then it's a problem from the origin (DB). What you can do, and you are actually doing, is to wrap the call into your custom methd that return just the scalar value.

David Elizondo | LLBLGen Support Team