-
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.
Fix for 15759. Update an error message for FK properties mismatch (#2…
…0616) Fix for 15759. Update the error message to include the entity types or navigations involved.
- Loading branch information
Showing
7 changed files
with
97 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 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.Diagnostics; | ||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Diagnostics | ||
{ | ||
/// <summary> | ||
/// A <see cref="DiagnosticSource" /> event payload class for | ||
/// incompatible foreign key properties. | ||
/// </summary> | ||
public class ForeignKeyCandidateEventData : TwoPropertyBaseCollectionsEventData | ||
{ | ||
/// <summary> | ||
/// Constructs the event payload. | ||
/// </summary> | ||
/// <param name="eventDefinition"> The event definition. </param> | ||
/// <param name="messageGenerator"> A delegate that generates a log message for this event. </param> | ||
/// <param name="dependentToPrincipalNavigationSpecification"> The name of the navigation property or entity type on the dependent end of the relationship. </param> | ||
/// <param name="principalToDependentNavigationSpecification"> The name of the navigation property or entity type on the principal end of the relationship. </param> | ||
/// <param name="firstPropertyCollection"> The first property collection. </param> | ||
/// <param name="secondPropertyCollection"> The second property collection. </param> | ||
public ForeignKeyCandidateEventData( | ||
[NotNull] EventDefinitionBase eventDefinition, | ||
[NotNull] Func<EventDefinitionBase, EventData, string> messageGenerator, | ||
[NotNull] string dependentToPrincipalNavigationSpecification, | ||
[NotNull] string principalToDependentNavigationSpecification, | ||
[NotNull] IReadOnlyList<IPropertyBase> firstPropertyCollection, | ||
[NotNull] IReadOnlyList<IPropertyBase> secondPropertyCollection) | ||
: base(eventDefinition, messageGenerator, firstPropertyCollection, secondPropertyCollection) | ||
{ | ||
DependentToPrincipalNavigationSpecification = dependentToPrincipalNavigationSpecification; | ||
PrincipalToDependentNavigationSpecification = principalToDependentNavigationSpecification; | ||
} | ||
|
||
/// <summary> | ||
/// The name of the navigation property or entity type on the dependent end of the relationship. | ||
/// </summary> | ||
public virtual string DependentToPrincipalNavigationSpecification { get; } | ||
|
||
/// <summary> | ||
/// The name of the navigation property or entity type on the principal end of the relationship. | ||
/// </summary> | ||
public virtual string PrincipalToDependentNavigationSpecification { get; } | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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