Skip to content

Commit c385bbe

Browse files
committed
Restore tree to d194d84
1 parent 292fc7d commit c385bbe

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/EFCore.Ydb/src/Storage/Internal/YdbTypeMappingSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ RelationalTypeMappingSourceDependencies relationalDependencies
111111
{ typeof(TimeSpan), Interval }
112112
};
113113

114-
private readonly ConcurrentDictionary<RelationalTypeMappingInfo, RelationalTypeMapping> _decimalCache = new();
114+
private static readonly ConcurrentDictionary<RelationalTypeMappingInfo, RelationalTypeMapping> DecimalCache = new();
115115

116116
protected override RelationalTypeMapping? FindMapping(in RelationalTypeMappingInfo mappingInfo)
117117
{
118118
if (mappingInfo.ClrType == typeof(decimal))
119119
{
120-
return _decimalCache.GetOrAdd(mappingInfo, static mi => Decimal.Clone(mi));
120+
return DecimalCache.GetOrAdd(mappingInfo, static mi => Decimal.Clone(mi));
121121
}
122122

123123
return base.FindMapping(mappingInfo) ?? FindBaseMapping(mappingInfo)?.Clone(mappingInfo);

src/EFCore.Ydb/test/EntityFrameworkCore.Ydb.FunctionalTests/Query/DecimalParameterizedYdbTheoryTest.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ namespace EntityFrameworkCore.Ydb.FunctionalTests.Query;
99
public class DecimalParameterizedYdbTheoryTest(DecimalParameterQueryYdbFixture fixture)
1010
: IClassFixture<DecimalParameterQueryYdbFixture>
1111
{
12-
static DecimalParameterizedYdbTheoryTest()
13-
=> AppContext.SetSwitch("EntityFrameworkCore.Ydb.EnableParametrizedDecimal", true);
14-
1512
private DbContextOptions<ParametricDecimalContext> BuildOptions()
1613
{
1714
using var baseCtx = fixture.CreateContext();
@@ -94,7 +91,6 @@ public async Task Decimal_roundtrips_or_rounds_like_ado(int p, int s, decimal va
9491
[MemberData(nameof(OverflowCases))]
9592
public async Task Decimal_overflow_bubbles_up(int p, int s, decimal value)
9693
{
97-
AppContext.SetSwitch("EntityFrameworkCore.Ydb.EnableParametrizedDecimal", true);
9894
await using var ctx = NewCtx(p, s);
9995
await ctx.Database.EnsureCreatedAsync();
10096

src/EFCore.Ydb/test/EntityFrameworkCore.Ydb.FunctionalTests/Query/ParametricDecimalContext.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ internal sealed class CacheKeyFactory : IModelCacheKeyFactory
3030
public object Create(DbContext context, bool designTime)
3131
{
3232
var ctx = (ParametricDecimalContext)context;
33-
var flag = AppContext.TryGetSwitch("EntityFrameworkCore.Ydb.EnableParametrizedDecimal", out var on) && on;
34-
35-
return (context.GetType(), designTime, ctx._p, ctx._s, flag);
33+
return (context.GetType(), designTime, ctx._p, ctx._s);
3634
}
3735
}
3836
}

0 commit comments

Comments
 (0)