Skip to content

Commit

Permalink
Quirk RelationalPropertyExtensions.GetConfiguredColumnType()
Browse files Browse the repository at this point in the history
  • Loading branch information
bricelam committed Aug 28, 2017
1 parent 1c0a2fe commit 0817523
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -26,6 +27,9 @@ public static string FormatColumns([NotNull] this IEnumerable<IProperty> propert
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
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];
}
}

0 comments on commit 0817523

Please sign in to comment.