Because of the using blocks, these one line methods need the async
modifier so that the that async state machiner is created. Otherwise, if
the method does not complete synchronously, the connection is closed
before the database has returned its results.
returnconnection.QueryAsync<dynamic>(@"SELECT o.[Id] as ordernumber,o.[OrderDate] as [date],os.[Name] as [status],SUM(oi.units*oi.unitprice) as total
returnawaitconnection.QueryAsync<dynamic>(@"SELECT o.[Id] as ordernumber,o.[OrderDate] as [date],os.[Name] as [status],SUM(oi.units*oi.unitprice) as total