Skip to content

Commit ed6ca86

Browse files
cmeerensmoothdeveloper
authored andcommitted
Use optional parameters if default value is not NULL
1 parent 185d5a1 commit ed6ca86

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/SqlClient.DesignTime/DesignTime.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,10 @@ type DesignTime private() =
588588
if p.Optional
589589
then
590590
assert(p.Direction = ParameterDirection.Input)
591-
ProvidedParameter(parameterName, parameterType = typedefof<_ option>.MakeGenericType(p.TypeInfo.ClrType))
591+
if p.DefaultValue.IsNone then
592+
ProvidedParameter(parameterName, parameterType = typedefof<_ option>.MakeGenericType(p.TypeInfo.ClrType))
593+
else
594+
ProvidedParameter(parameterName, parameterType = typedefof<_ option>.MakeGenericType(p.TypeInfo.ClrType), optionalValue = null)
592595
else
593596
if p.Direction.HasFlag(ParameterDirection.Output)
594597
then

0 commit comments

Comments
 (0)