-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For reverse engineered procedures, it's not possible to set an initial value for an out parameter #1069
Comments
Please provide a full repro using for example Northwind, and I will have a look |
Are you proposing it should be always "InputOutput" ? |
Ping? |
I am not sure about the backwards compatibility of that (also is there a possible performance impact?). On the other hand, I also have no idea if there is another way to decide which one to use, short of making it a global option.
I'll try to as soon as I can, if that is still needed. Sorry for the late response. |
Does everything work as expected if you change all Output parameters to Input output? |
No need for repro - I will try to make it always InputOutput for now, and if issues arise, make a global switch to revert to current implementation. |
It does for me and I can't think of any way it could cause a problem, but I am by no means an expert at SQL Server stuff. (sorry again for the late response) |
Thanks, I also looked at a tool similar to mine, and it maps all non input parameters as input/output, so I will just change to that. |
Thanks for reporting this! |
Fixed in latest daily |
Thanks |
@HimbeersaftLP If you would like this fixed, please provide a repro so I can understand the issue better. |
In looking through the code to open up my redundant bug report, I got to this point, thinking you'll have to retrieve the supplied value from the passed in via your auto-generated I found this as a good discussion about the behavior when mixing these directions with default values in the T-SQL. |
I implemented a fix for this in the latest daily build, would be grateful if you could try it out. |
Yeah INPUT/OUTPUT parameter is required when we are creating and updating any record to table using same(single) stored procedure. So for create , no value will be set to input/output parameter and after saving record , id of new record will be returned through input/output parameter. Thanks Hank for adding the missing functionality to EF Core Power Tools. |
@Durgesh132 I created the PR - but have you verified the latest daily build works as expected? |
@ErikEJ @whschultz |
SQL Server procedures allow the executor to define an initial value for parameters declared as "OUTPUT".
The method generated by EF Core Power Tools' reverse engineering feature however, has the direction of the SqlParameter hardcoded to Output (as opposed to InputOutput).
EFCorePowerTools/src/GUI/RevEng.Core/Procedures/SqlServerStoredProcedureScaffolder.cs
Line 334 in 380e02a
Steps to reproduce
Further technical details
EF Core Power Tools version: 2.5.692
Database engine: SQL Server
Visual Studio version: Visual Studio 2019 16.10.4
The text was updated successfully, but these errors were encountered: