Skip to content

Reuse the parameters if possible #32

@0Lucifer0

Description

@0Lucifer0

Would be nice if the parameters that already exists were reused.
I believe the only change required for this are to move away from IList to IList
and use this in AppendRowsAsValues

    var parameter = value?.GetType().IsValueType == true ? parameters.FirstOrDefault(x => x.Value == value) : null;
                        var paramName = parameter?.ParameterName ?? $"{paramPattern}{i}";

                        if (parameter == null)
                        {
                            var param = command.CreateParameter();
                            param.ParameterName = paramName;
                            param.Value = value;
                            parameters.Add(param);
                            i++;
                        }

                        sb.Append(paramName);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions