Skip to content

Commit fa5d56f

Browse files
committed
Remove the -As parameter from the Get-Scalar method
1 parent 527f703 commit fa5d56f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Sql.Cmdlets/Get-Scalar.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ namespace Belin.Sql.Cmdlets;
99
[Cmdlet(VerbsCommon.Get, "Scalar"), OutputType(typeof(object))]
1010
public class GetScalarCommand: Cmdlet {
1111

12-
/// <summary>
13-
/// The type of object to return.
14-
/// </summary>
15-
[Parameter]
16-
public Type As { get; set; } = typeof(object);
17-
1812
/// <summary>
1913
/// The SQL query to be executed.
2014
/// </summary>
@@ -56,7 +50,7 @@ public class GetScalarCommand: Cmdlet {
5650
/// </summary>
5751
protected override void ProcessRecord() {
5852
try {
59-
var method = typeof(ConnectionExtensions).GetMethod(nameof(ConnectionExtensions.ExecuteScalar))!.MakeGenericMethod(As);
53+
var method = typeof(ConnectionExtensions).GetMethod(nameof(ConnectionExtensions.ExecuteScalar))!.MakeGenericMethod(typeof(object));
6054
var value = method.Invoke(null, [Connection, Command, Parameters, new CommandOptions(Timeout, Transaction, CommandType)]);
6155
WriteObject(value);
6256
}

0 commit comments

Comments
 (0)