EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

Stored proc with multiple returns

Open lipanna opened this issue 1 year ago • 3 comments

I'm calling SP that has 5 of these conditions:

If (condition) select a, b, c... RETURN 0;

If (condition) select a, b, c... RETURN 0;

SP always returns only one resultset. Each select has exactly the same columns. However, generated POCO contains 5 resultsets and I get an error message that EF doesn't support multiple resultsets. Is there a way around it? EF Core 6. Thanks.

lipanna avatar Jan 26 '24 15:01 lipanna

@lipanna in your connection string add ;MultipleActiveResultSets=True

sjh37 avatar Jan 27 '24 13:01 sjh37

Hi Simon, It is there by default, but doesn't seem to work...

Settings.ConnectionString = "Data Source=xxx;Initial Catalog=xxx;Integrated Security=True;MultipleActiveResultSets=True;Encrypt=false;TrustServerCertificate=true";

lipanna avatar Jan 29 '24 15:01 lipanna

Piggy-backing on this - there's been no "magic" added to the latest versions of EF Reverse POCO to make up for the lack of EF Core's support for returning multiple result sets or table variables, right? We have to roll our own solution?

// public async Task<UspMemberStatusReportGetReturnModel> UspMemberStatusReportGetAsync() Cannot be created as EF Core does not yet support stored procedures with multiple result sets.

NeilN1 avatar Jul 20 '24 00:07 NeilN1