Closed dalibormesaric closed 1 year ago
How does ValueTask\<T> help here?
It just makes it so that the code in the example compiles. But I learned that there is also FindAsync().AsTask() so I can modify my PR to that.
Why would we change it to a ValueTask?
You don't have to change it to ValueTask, it will work with FindAsync().AsTask() instead.
Here is what I'm talking about:
c/p example
with ValueTask
with .AsTask()
Got it, you have a method that didn;t return ValueTask, I understand now. Using AsTask makes sense there. I think we can close this.
I copy/pasted the examples and got compiler errors. Then I checked FindAsync signature, and it expects ValueTask instead of Task, so I thought I could update the document,
https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.findasync?view=efcore-6.0