Esempio n. 1
0
        public override async Task <int> ExecuteOnAsync(IAsyncCommandChannel on)
        {
            var affectedLines = await base.ExecuteOnAsync(on);

            if (affectedLines != _values)
            {
                throw new Exception($"Tentative d'insertion de {_values} lignes, seulement {affectedLines} insérée(s)");
            }
            return(affectedLines);
        }
Esempio n. 2
0
 public virtual async Task <TResultType> ExecuteOnAsync(IAsyncCommandChannel on)
 => await _executor.ExecuteOnAdapterAsync(on, Statement.Sql, Statement.Parameters);
Esempio n. 3
0
        public async Task <bool> ExecuteOnAdapterAsync(IAsyncCommandChannel adapter, string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null)
        {
            var value = await adapter.FetchValueAsync(sql, parameters);

            return(Convert.ToBoolean(value));
        }
Esempio n. 4
0
 public async Task <int> ExecuteOnAdapterAsync(IAsyncCommandChannel adapter, string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null)
 => await adapter.ExecuteAsync(sql, parameters);
Esempio n. 5
0
 public async Task <IReadOnlyDictionary <string, IConvertible> > ExecuteOnAdapterAsync(IAsyncCommandChannel adapter, string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null)
 => await adapter.FetchLineAsync(sql, parameters);
        public static async Task <IConvertible> ExecuteOnAndReturnRowIdAsync(this ITableInsert insert, IAsyncCommandChannel on)
        {
            await insert.ExecuteOnAsync(on);

            return(await on.LastInsertedIdAsync());
        }
Esempio n. 7
0
 public AsyncCommandChannelLogger(IAsyncCommandChannel logged, ILogger <IAsyncCommandChannel> logger)
 {
     _logged = logged;
     _logger = logger;
 }
Esempio n. 8
0
        public async Task <IReadOnlyList <IConvertible> > ExecuteOnAdapterAsync(IAsyncCommandChannel adapter, string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null)
        {
            var lines = await adapter.FetchLinesAsync(sql, parameters);

            return(ParseResultLines(lines));
        }