async Task <Tuple <bool, string> > ExecuteRefParameterAsync(IDbConnection db) { var p = new SquareInput { value = 4 }; await db.ExecuteAsync(Program.timeout).usp_Square(p); if (p.value != 16) { return(Tuple.Create(false, $"The value was not squared after the stored procedure completed. Expected 16, value is {p.value}.")); } return(Tuple.Create(true, "")); }
Task <Tuple <bool, string> > ExecuteNonQueryAsyncRefParameterTask(IDbConnection db) { var p = new SquareInput { value = 4 }; Task t = db.ExecuteNonQueryAsync(Program.timeout).usp_Square(p); return(t.ContinueWith(r => { if (p.value != 16) { return Tuple.Create(false, $"The value was not squared after the stored procedure completed. Expected 16, value is {p.value}."); } return Tuple.Create(true, ""); })); }