File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,15 @@ public SqlParameter this[string name] {
3030 }
3131 }
3232
33+ /// <summary>
34+ /// Creates a new parameter collection from the specified array of positional parameters.
35+ /// </summary>
36+ /// <param name="parameters">The array whose elements are copied to the parameter collection.</param>
37+ /// <returns>The parameter collection corresponding to the specified array of positional parameters.</returns>
38+ public static implicit operator SqlParameterCollection ( object ? [ ] parameters ) => [ .. parameters . Select ( ( value , index ) =>
39+ value is SqlParameter parameter ? parameter : new SqlParameter ( $ "?{ index + 1 } ", value )
40+ ) ] ;
41+
3342 /// <summary>
3443 /// Creates a new parameter collection from the specified list of positional parameters.
3544 /// </summary>
You can’t perform that action at this time.
0 commit comments