Skip to content

Commit

Permalink
Remove unchecks in SQL Server type mappings (#30164)
Browse files Browse the repository at this point in the history
Closes #30111
  • Loading branch information
roji authored Feb 4, 2023
1 parent 5045b40 commit b52ca81
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected override void ConfigureParameter(DbParameter parameter)
if (Precision.HasValue)
{
// Workaround for inconsistent definition of precision/scale between EF and SQLClient for VarTime types
parameter.Scale = unchecked((byte)Precision.Value);
parameter.Scale = (byte)Precision.Value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected override void ConfigureParameter(DbParameter parameter)
{
// SQL Server accepts a scale, but in EF a scale along isn't supported (without precision).
// So the actual value is contained as precision in scale, but sent as Scale to SQL Server.
parameter.Scale = unchecked((byte)Precision.Value);
parameter.Scale = (byte)Precision.Value;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ protected override void ConfigureParameter(DbParameter parameter)

if (Precision.HasValue)
{
parameter.Precision = unchecked((byte)Precision.Value);
parameter.Precision = (byte)Precision.Value;
}

if (Scale.HasValue)
{
parameter.Scale = unchecked((byte)Scale.Value);
parameter.Scale = (byte)Scale.Value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected override void ConfigureParameter(DbParameter parameter)

if (Precision.HasValue)
{
parameter.Scale = unchecked((byte)Precision.Value);
parameter.Scale = (byte)Precision.Value;
}
}

Expand Down

0 comments on commit b52ca81

Please sign in to comment.