From 104bb4dcb75c22af892ea25406965f88efe7d650 Mon Sep 17 00:00:00 2001 From: AndriySvyryd Date: Thu, 12 Jul 2018 14:17:16 -0700 Subject: [PATCH] Add quirk mode for issue #12557 --- src/EFCore.Relational/Storage/RelationalTypeMapping.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EFCore.Relational/Storage/RelationalTypeMapping.cs b/src/EFCore.Relational/Storage/RelationalTypeMapping.cs index fe9fc394e0a..bdacd91d1db 100644 --- a/src/EFCore.Relational/Storage/RelationalTypeMapping.cs +++ b/src/EFCore.Relational/Storage/RelationalTypeMapping.cs @@ -361,7 +361,8 @@ public virtual DbParameter CreateParameter( parameter.ParameterName = name; if (Converter != null - && !IsLegacyEnumValue(Converter, value)) + && ((AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue12557", out var isEnabled) && isEnabled) + || !IsLegacyEnumValue(Converter, value))) { value = Converter.ConvertToProvider(value); }