Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/EFCore/Metadata/Internal/InternalTypeBaseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Internal;
public abstract class InternalTypeBaseBuilder : AnnotatableBuilder<TypeBase, InternalModelBuilder>,
IConventionTypeBaseBuilder
{
private static readonly bool UseOldBehavior34201 =
AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue34201", out var enabled34201) && enabled34201;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
Expand Down Expand Up @@ -204,6 +207,7 @@ public static bool IsCompatible(MemberInfo? newMemberInfo, PropertyBase existing
|| (memberInfo is PropertyInfo propertyInfo && propertyInfo.IsIndexerProperty()))
{
if (existingProperty.GetTypeConfigurationSource() is ConfigurationSource existingTypeConfigurationSource
&& (typeConfigurationSource != null || UseOldBehavior34201)
&& !typeConfigurationSource.Overrides(existingTypeConfigurationSource))
{
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8646,7 +8646,7 @@ public void Split_out_subtype_with_seed_data()
x.Property<string>("Name");
x.Property<int>("Discriminator");

x.HasDiscriminator<int>("Discriminator")
x.HasDiscriminator()
.HasValue(1)
.HasValue<Eagle>(2);

Expand Down