sjh37 / EntityFramework-Reverse-POCO-Code-First-Generator

EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
https://www.reversepoco.co.uk/
Other
709 stars 227 forks source link

Stored proc with multiple returns #830

Open lipanna opened 9 months ago

lipanna commented 9 months ago

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.

sjh37 commented 9 months ago

@lipanna in your connection string add ;MultipleActiveResultSets=True

lipanna commented 9 months ago

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";
NeilN1 commented 3 months ago

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 UspMemberStatusReportGetAsync() Cannot be created as EF Core does not yet support stored procedures with multiple result sets.