diff --git a/src/EFCore.Jet/Storage/Internal/JetDecimalTypeMapping.cs b/src/EFCore.Jet/Storage/Internal/JetDecimalTypeMapping.cs index 5b313a6..12de982 100644 --- a/src/EFCore.Jet/Storage/Internal/JetDecimalTypeMapping.cs +++ b/src/EFCore.Jet/Storage/Internal/JetDecimalTypeMapping.cs @@ -53,7 +53,20 @@ namespace EntityFrameworkCore.Jet.Storage.Internal /// doing so can result in application failures when updating to a new Entity Framework Core release. /// protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) - => new JetDecimalTypeMapping(parameters); + { + var precision = parameters.Precision; + var scale = parameters.Scale; + if (parameters.Precision is > 28) + { + int prec_diff = parameters.Precision.Value - 28; + precision = 28; + if (parameters.Scale is > 28) + { + scale = parameters.Scale.Value - prec_diff; + } + } + return new JetDecimalTypeMapping(parameters.WithPrecisionAndScale(precision, scale)); + } /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to diff --git a/test/EFCore.Jet.FunctionalTests/config.json b/test/EFCore.Jet.FunctionalTests/config.json index 6c66070..d97040e 100644 --- a/test/EFCore.Jet.FunctionalTests/config.json +++ b/test/EFCore.Jet.FunctionalTests/config.json @@ -1,7 +1,7 @@ { - "Test": { - "Jet": { - "DefaultConnection": "DBQ=Jet.accdb" - } + "Test": { + "Jet": { + "DefaultConnection": "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Jet.accdb;Persist Security Info=False;" } + } }