I used Dapper and return a dynamic IEnumerable, for example:
var rows = conn.Query("SELECT * FROM T WHERE ID = @id", new { id = tableId }); var row = rows.FirstOrDefault();
Here rows is of type IEnumerable<dynamic> . IntelliSense says FirstOrDefault() is expected and has await FirstOrDefault() . Not all LINQ queries appear as expected, but seem to be especially those that highlight some elements.
As soon as I use strong typing instead, this behavior disappears.
This is because .NET cannot know if the type you are getting at runtime expects it or not to let it "resolve" if you need it? But does not enforce it? Or should I, due to some behavior of the dynamic Runtime language, use await here?
I continued to search, but did not find the smallest thing about it on the Internet.
source share