I am using asp.net(mvc4) application,also I have used the repository design pattern. I want to return multiple result set from store procedure to entity framework object. Here is the code
Alter PROCEDURE DDDDD
@TicketID INT
AS
SELECT * FROM XXXXX WHERE TicketID= @TicketID
SELECT * FROM YYYY WHERE TicketID= @TicketID
END
KeyValuePair<string, object>[] lstparam = new KeyValuePair<string, object>[1];
lstparam[0] = new KeyValuePair<string, object>("TicketID", TicketID);
var obj = _getTroubleTicketDetails_Result.ExecuteCustomStoredProc("DDDDD", lstparam);
TroubleTicketDetails objDetails = new TroubleTicketDetails();
objDetails.TicketDetails.AddRange(obj);
return objDetails;
I want to have both result set in single sp call return by "DDDDD"
I'm no expert, but you should probably use a container or define a data structure/ class for that.