-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default embedded discriminator property from "Discriminator" t…
…o "$type" Fixes #34269 Use the following to revert back to the old behavior: ```C# modelBuilder.HasEmbeddedDiscriminatorName("Discriminator"); ```
- Loading branch information
1 parent
e667bf8
commit 181cf1b
Showing
51 changed files
with
1,657 additions
and
1,616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/EFCore/Metadata/Conventions/IModelEmbeddedDiscriminatorNameConvention.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions; | ||
|
||
/// <summary> | ||
/// Represents an operation that should be performed when the embedded discriminator name for the model changes. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-conventions">Model building conventions</see> for more information and examples. | ||
/// </remarks> | ||
public interface IModelEmbeddedDiscriminatorNameConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after <see cref="ModelBuilder.HasEmbeddedDiscriminatorName"/> has been called. | ||
/// </summary> | ||
/// <param name="modelBuilder">The builder for the model.</param> | ||
/// <param name="oldName">The current discriminator name.</param> | ||
/// <param name="newName">The new discriminator name.</param> | ||
/// <param name="context">Additional information associated with convention execution.</param> | ||
void ProcessEmbeddedDiscriminatorName( | ||
IConventionModelBuilder modelBuilder, | ||
string? oldName, | ||
string? newName, | ||
IConventionContext<string> context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.