コード例 #1
0
        async Task <Tuple <bool, string> > AsyncAwaitGetReturnValueWithInputProperty(IDbConnection db)
        {
            var input = new ReturnsOne();
            await db.ExecuteNonQueryAsync(Program.timeout).usp_ReturnsOne(input);

            if (input.ReturnValue != 1)
            {
                return(Tuple.Create(false, "ReturnValue not set"));
            }

            return(Tuple.Create(true, ""));
        }
コード例 #2
0
        Task <Tuple <bool, string> > AsyncTaskGetReturnValueWithInputProperty(IDbConnection db)
        {
            var  input = new ReturnsOne();
            Task t     = db.ExecuteNonQueryAsync(Program.timeout).usp_ReturnsOne(input);

            return(t.ContinueWith(_ =>
            {
                if (input.ReturnValue != 1)
                {
                    return Tuple.Create(false, "ReturnValue not set");
                }

                return Tuple.Create(true, "");
            }));
        }