Ejemplo n.º 1
0
        public ISqlResultPromise Add(ISqlCommand command)
        {
            Argument.NotNull(command, nameof(command));
            var result = new SqlResultPromise();

            AddExecutor((c, i) =>
            {
                new SqlCommandStrategy(_interactionFactory).Execute(command, c, i);
                result.SetComplete();
            });
            return(result);
        }
Ejemplo n.º 2
0
        public ISqlResultPromise <T> Add <T>(ISqlCommand <T> command)
        {
            Argument.NotNull(command, nameof(command));
            var promise = new SqlResultPromise <T>();

            AddExecutor((c, i) =>
            {
                var result = new SqlCommandStrategy(_interactionFactory).Execute(command, c, i);
                promise.SetValue(result);
            });
            return(promise);
        }
Ejemplo n.º 3
0
        public ISqlResultPromise <T> Add <T>(ISqlQuery query, IResultMaterializer <T> reader)
        {
            Argument.NotNull(query, nameof(query));
            Argument.NotNull(reader, nameof(reader));
            var promise = new SqlResultPromise <T>();

            AddExecutor((c, i) =>
            {
                var result = new SqlQueryStrategy(_interactionFactory).Execute(query, reader, c, i);
                promise.SetValue(result);
            });
            return(promise);
        }