From 08175238a0c631d12c954f028a433b741732d1bd Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 28 Aug 2017 15:19:49 -0700 Subject: [PATCH] Quirk RelationalPropertyExtensions.GetConfiguredColumnType() --- .../Internal/RelationalPropertyExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/EFCore.Relational/Internal/RelationalPropertyExtensions.cs b/src/EFCore.Relational/Internal/RelationalPropertyExtensions.cs index 6dd5166f348..ee4c9a35440 100644 --- a/src/EFCore.Relational/Internal/RelationalPropertyExtensions.cs +++ b/src/EFCore.Relational/Internal/RelationalPropertyExtensions.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.Collections.Generic; using System.Linq; using JetBrains.Annotations; @@ -26,6 +27,9 @@ public static string FormatColumns([NotNull] this IEnumerable propert /// directly from your code. This API may change or be removed in future releases. /// public static string GetConfiguredColumnType([NotNull] this IProperty property) - => (string)property[RelationalAnnotationNames.ColumnType]; + => AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Metadata.UseTypeMappingAlways", out var isPresent) + && isPresent + ? property.Relational().ColumnType + : (string)property[RelationalAnnotationNames.ColumnType]; } }