-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
The output parameter got a value 'null' of Stored Procedure. #10925
Comments
Duplicate of #9277 Which version of EF Core are you using? This has been fixed in 2.0.1 version. |
@smitpatel But i'm using the 2.0.1 version. |
Is value of |
@smitpatel The prms[2].Value is null. |
@Whatsaf - Please share a repro code which can demonstrate the issue. In above code snippet, |
Finally, call the
and the returnCode will be 0, not 1 expected. |
@Whatsaf As @smitpatel said above, the output parameter will not be set until after the query has been enumerated. In other words, you'll need to run result.ToList() before getting the value: var queryResults = result.ToList();
returnCode = Convert.ToInt32(parameters[0].Value);
return queryResults; This is the behavior of the SQL Server provider for .NET (SqlClient) and is not something that EF can change. |
@ajcvickers I'm so sorry about that, i just couldn't understood what smitpatel said. But now with the codes, i can understand that clearly. Now, the codes runs well. Apologize for my foolish. |
I have a own-defined DbSet<> class, after i call the FromSql method, i got a value null.
I can ensure the
procCreateDirectOrder
runs well, but the prms[2].Value is null.The text was updated successfully, but these errors were encountered: