Exemplo n.º 1
0
        private SqlQueryFormatResult(SqlQueryFormatter formatter, string commandText, IReadOnlyList <TypedValue> parameterValues, Dictionary <int, int> parameterIndexToPlaceholderIndexes, Dictionary <int, int> placeholderIndexToParameterIndexes)
        {
            this.Formatter       = formatter;
            this.CommandText     = commandText;
            this.ParameterValues = parameterValues;

            this.ParameterIndexToPlaceholderIndexes = parameterIndexToPlaceholderIndexes;
            this.PlaceholderIndexToParameterIndex   = placeholderIndexToParameterIndexes;
        }
Exemplo n.º 2
0
        public SqlQueryFormatResult(SqlQueryFormatter formatter, string commandText, IReadOnlyList <TypedValue> parameterValues, IReadOnlyList <Pair <int, int> > parameterIndexToPlaceholderIndexes)
        {
            this.Formatter       = formatter;
            this.CommandText     = commandText;
            this.ParameterValues = parameterValues;

            if (parameterIndexToPlaceholderIndexes?.Count > 0)
            {
                this.ParameterIndexToPlaceholderIndexes = new Dictionary <int, int>();
                this.PlaceholderIndexToParameterIndex   = new Dictionary <int, int>();

                foreach (var value in parameterIndexToPlaceholderIndexes)
                {
                    this.ParameterIndexToPlaceholderIndexes[value.Left] = value.Right;
                    this.PlaceholderIndexToParameterIndex[value.Right]  = value.Left;
                }
            }
        }
Exemplo n.º 3
0
 public SqlQueryFormatResult(SqlQueryFormatter formatter, string commandText, IEnumerable <TypedValue> parameterValues, IReadOnlyList <Pair <int, int> > parameterIndexToPlaceholderIndexes)
     : this(formatter, commandText, parameterValues.ToReadOnlyCollection(), parameterIndexToPlaceholderIndexes)
 {
 }