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
700 stars 230 forks source link

Stored proc with multiple returns #830

Open lipanna opened 5 months ago

lipanna commented 5 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 5 months ago

@lipanna in your connection string add ;MultipleActiveResultSets=True

lipanna commented 5 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";