public IConvertible FetchValue(string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null) { using var scope = _logger.BeginScope("Query {Guid} of type {Type}", Guid.NewGuid(), nameof(FetchValue)); var enumeratedParameters = parameters?.ToArray() ?? new KeyValuePair <string, IConvertible> [0]; LogInputParameters(sql, enumeratedParameters); var value = _logged.FetchValue(sql, enumeratedParameters); _logger.LogDebug("{Value} returned.", value); return(value); }
public bool ExecuteOnAdapter(ICommandChannel adapter, string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null) { var value = adapter.FetchValue(sql, parameters); return(Convert.ToBoolean(value)); }
private static int GetCount(ICommandChannel adapter) { return(Convert.ToInt32(adapter.FetchValue("SELECT COUNT(*) FROM test"))); }
public IConvertible ExecuteOnAdapter(ICommandChannel adapter, string sql, IEnumerable <KeyValuePair <string, IConvertible> > parameters = null) => adapter.FetchValue(sql, parameters);