Skip to content
Advertisement

Stored procedure returns int instead of result set

I have a stored procedure that contains dynamic select. Something like this:

In SSMS the stored procedure runs fine and shows result set.

In C# using Entity Framework it shows returning an int instead of IEnumerable?

Generated function for usp_GetTestRecords

Advertisement

Answer

Entity Framework can’t tell what your stored procedure is returning. I’ve had success creating a table variable that mirrors the data from your SELECT statement. Just insert into the table variable then do a select from that table variable. EF should pick it up.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement