Skip to content

Commit 28850f2

Browse files
committed
Code optimization
1 parent f134861 commit 28850f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Sql/ParameterCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public ParameterCollection(string name, object? value, DbType? dbType = null, in
4848
/// <param name="array">The array whose elements are copied to the parameter list.</param>
4949
/// <returns>The parameter list corresponding to the specified array of positional parameters.</returns>
5050
public static implicit operator ParameterCollection(object?[] array) => [.. array.Index().Select(entry =>
51-
entry.Item is Parameter parameter ? parameter : new Parameter($"?{entry.Index}", entry.Item)
51+
entry.Item is Parameter parameter ? parameter : new Parameter($"?{entry.Index + 1}", entry.Item)
5252
)];
5353

5454
/// <summary>
@@ -64,7 +64,7 @@ public static implicit operator ParameterCollection(object?[] array) => [.. arra
6464
/// <param name="dictionary">The dictionary whose elements are copied to the parameter list.</param>
6565
/// <returns>The parameter list corresponding to the specified dictionary of named parameters.</returns>
6666
public static implicit operator ParameterCollection(Dictionary<string, object?> dictionary) => [.. dictionary.Select(entry =>
67-
entry.Value is Parameter parameter ? parameter : new Parameter($"@{entry.Key}", entry.Value)
67+
entry.Value is Parameter parameter ? parameter : new Parameter(entry.Key, entry.Value)
6868
)];
6969

7070
/// <summary>

0 commit comments

Comments
 (0)