-
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
Re-introduce detection for non-composable SQL in FromSql #17558
Comments
Maybe need to use dbo.GetHomeCarousel |
No it doesn't change anything. Thanks. |
Notes from triage: The code to detect non-composable SQL was removed in 3.0, since ideally we would not parse any SQL. However, if this catches enough people out, then we will consider re-introducing it. Putting this in backlog to gather votes/feedback. |
Thanks, |
Re-marking for triage. What is the composition here? I assume it's |
I am porting and running into this with |
Try:
|
There is very easy way to do this. |
Thanks. HomeCarouselViewModel viewModel = _context.HomeCarouselViewModel.FromSqlRaw("EXECUTE GetHomeCarousel").AsNoTracking().AsEnumerable().FirstOrDefault(); But it's synchronous. In order to use Asynchronous operation I Thought I could use AsEnumerableAsync() but HomeCarouselViewModel viewModel = _context.HomeCarouselViewModel.FromSqlRaw("EXECUTE GetHomeCarousel").AsNoTracking().AsAsyncEnumerable().GetAsyncEnumerator().Current; returns null. |
Did you forget await ? |
Step-by-step
You have initialized your enumerator but haven't moved it yet so |
Also fix issues tags - Tags are erased when SelectExpression is recreated during visitation - Tags are not printed for non-composed FromSql* Resolves #17558
Also fix issues tags - Tags are erased when SelectExpression is recreated during visitation - Tags are not printed for non-composed FromSql* Resolves #17558
Also fix issues tags - Tags are erased when SelectExpression is recreated during visitation - Tags are not printed for non-composed FromSql* Resolves #17558
Also fix issues tags - Tags are erased when SelectExpression is recreated during visitation - Tags are not printed for non-composed FromSql* Resolves #17558
this worked for me just fine string sqlQuery = "EXEC [dbo].[PaperBatch_INSERT] @UserName,@SupplierID,@OrDerno,@RecvDat,@FROMno,@tono,@notes"; resp = this.SPResponse.FromSqlRaw(sqlQuery, |
It should works like that. It seem so odd to workaround with AsEnumarable. |
.Net core 3 preview 8
I get this exception:
Incorrect syntax near the keyword 'EXEC'
Worked perfectly with ef core 2.2
The text was updated successfully, but these errors were encountered: