We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46be20d commit f02d583Copy full SHA for f02d583
src/EFCore.Ydb/src/Storage/Internal/Mapping/YdbDecimalTypeMapping.cs
@@ -1,3 +1,4 @@
1
+using System;
2
using System.Data.Common;
3
using Microsoft.EntityFrameworkCore.Storage;
4
@@ -34,9 +35,14 @@ protected override string ProcessStoreType(
34
35
protected override void ConfigureParameter(DbParameter parameter)
36
{
37
base.ConfigureParameter(parameter);
38
+
39
var p = (byte)(Precision ?? DefaultPrecision);
40
var s = (byte)(Scale ?? DefaultScale);
41
42
parameter.Precision = p;
43
parameter.Scale = s;
44
45
+ if (parameter.Value is decimal d)
46
+ parameter.Value = decimal.Round(d, s, MidpointRounding.ToEven);
47
}
48
0 commit comments