-
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.
Add skip navigation support in Metadata
Part of #19003
- Loading branch information
1 parent
dc1e811
commit 2aefa91
Showing
56 changed files
with
3,856 additions
and
483 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
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
22 changes: 22 additions & 0 deletions
22
src/EFCore/Metadata/Builders/IConventionSkipNavigationBuilder.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,22 @@ | ||
// 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. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Builders | ||
{ | ||
/// <summary> | ||
/// <para> | ||
/// Provides a simple API surface for configuring an <see cref="IConventionSkipNavigation" /> from conventions. | ||
/// </para> | ||
/// <para> | ||
/// This interface is typically used by database providers (and other extensions). It is generally | ||
/// not used in application code. | ||
/// </para> | ||
/// </summary> | ||
public interface IConventionSkipNavigationBuilder : IConventionAnnotatableBuilder | ||
{ | ||
/// <summary> | ||
/// The navigation property being configured. | ||
/// </summary> | ||
new IConventionSkipNavigation Metadata { 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
31 changes: 31 additions & 0 deletions
31
src/EFCore/Metadata/Conventions/INavigationAnnotationChangedConvention.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,31 @@ | ||
// 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 JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions | ||
{ | ||
/// <summary> | ||
/// Represents an operation that should be performed when an annotation is changed on a navigation. | ||
/// </summary> | ||
public interface INavigationAnnotationChangedConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after an annotation is changed on a navigation. | ||
/// </summary> | ||
/// <param name="relationshipBuilder"> The builder for the foreign key. </param> | ||
/// <param name="navigation"> The navigation. </param> | ||
/// <param name="name"> The annotation name. </param> | ||
/// <param name="annotation"> The new annotation. </param> | ||
/// <param name="oldAnnotation"> The old annotation. </param> | ||
/// <param name="context"> Additional information associated with convention execution. </param> | ||
void ProcessNavigationAnnotationChanged( | ||
[NotNull] IConventionRelationshipBuilder relationshipBuilder, | ||
[NotNull] IConventionNavigation navigation, | ||
[NotNull] string name, | ||
[CanBeNull] IConventionAnnotation annotation, | ||
[CanBeNull] IConventionAnnotation oldAnnotation, | ||
[NotNull] IConventionContext<IConventionAnnotation> context); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/EFCore/Metadata/Conventions/IPropertyRemovedConvention.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,25 @@ | ||
// 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 JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions | ||
{ | ||
/// <summary> | ||
/// Represents an operation that should be performed when a property is removed from the entity type. | ||
/// </summary> | ||
public interface IPropertyRemovedConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after a property is removed from the entity type. | ||
/// </summary> | ||
/// <param name="entityTypeBuilder"> The builder for the entity type that contained the property. </param> | ||
/// <param name="property"> The removed property. </param> | ||
/// <param name="context"> Additional information associated with convention execution. </param> | ||
void ProcessPropertyRemoved( | ||
[NotNull] IConventionEntityTypeBuilder entityTypeBuilder, | ||
[NotNull] IConventionProperty property, | ||
[NotNull] IConventionContext<IConventionProperty> context); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/EFCore/Metadata/Conventions/ISkipNavigationAddedConvention.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,23 @@ | ||
// 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 JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions | ||
{ | ||
/// <summary> | ||
/// Represents an operation that should be performed when a skip navigation is added to the entity type. | ||
/// </summary> | ||
public interface ISkipNavigationAddedConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after a skip navigation is added to the entity type. | ||
/// </summary> | ||
/// <param name="skipNavigationBuilder"> The builder for the skip navigation. </param> | ||
/// <param name="context"> Additional information associated with convention execution. </param> | ||
void ProcessSkipNavigationAdded( | ||
[NotNull] IConventionSkipNavigationBuilder skipNavigationBuilder, | ||
[NotNull] IConventionContext<IConventionSkipNavigationBuilder> context); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/EFCore/Metadata/Conventions/ISkipNavigationAnnotationChangedConvention.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,29 @@ | ||
// 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 JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions | ||
{ | ||
/// <summary> | ||
/// Represents an operation that should be performed when an annotation is changed on a skip navigation. | ||
/// </summary> | ||
public interface ISkipNavigationAnnotationChangedConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after an annotation is changed on a skip navigation. | ||
/// </summary> | ||
/// <param name="skipNavigationBuilder"> The builder for the skip navigation. </param> | ||
/// <param name="name"> The annotation name. </param> | ||
/// <param name="annotation"> The new annotation. </param> | ||
/// <param name="oldAnnotation"> The old annotation. </param> | ||
/// <param name="context"> Additional information associated with convention execution. </param> | ||
void ProcessSkipNavigationAnnotationChanged( | ||
[NotNull] IConventionSkipNavigationBuilder skipNavigationBuilder, | ||
[NotNull] string name, | ||
[CanBeNull] IConventionAnnotation annotation, | ||
[CanBeNull] IConventionAnnotation oldAnnotation, | ||
[NotNull] IConventionContext<IConventionAnnotation> context); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/EFCore/Metadata/Conventions/ISkipNavigationInverseChangedConvention.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,27 @@ | ||
// 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 JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions | ||
{ | ||
/// <summary> | ||
/// Represents an operation that should be performed when a skip navigation inverse is changed. | ||
/// </summary> | ||
public interface ISkipNavigationInverseChangedConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after a skip navigation inverse is changed. | ||
/// </summary> | ||
/// <param name="skipNavigationBuilder"> The builder for the skip navigation. </param> | ||
/// <param name="inverse"> The current inverse skip navigation. </param> | ||
/// <param name="oldInverse"> The old inverse skip navigation. </param> | ||
/// <param name="context"> Additional information associated with convention execution. </param> | ||
void ProcessSkipNavigationInverseChanged( | ||
[NotNull] IConventionSkipNavigationBuilder skipNavigationBuilder, | ||
[NotNull] IConventionSkipNavigation inverse, | ||
[NotNull] IConventionSkipNavigation oldInverse, | ||
[NotNull] IConventionContext<IConventionSkipNavigation> context); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/EFCore/Metadata/Conventions/ISkipNavigationRemovedConvention.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,25 @@ | ||
// 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 JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions | ||
{ | ||
/// <summary> | ||
/// Represents an operation that should be performed when a skip navigation is removed from the entity type. | ||
/// </summary> | ||
public interface ISkipNavigationRemovedConvention : IConvention | ||
{ | ||
/// <summary> | ||
/// Called after a skip navigation is removed from the entity type. | ||
/// </summary> | ||
/// <param name="entityTypeBuilder"> The builder for the entity type that contained the navigation. </param> | ||
/// <param name="navigation"> The removed navigation. </param> | ||
/// <param name="context"> Additional information associated with convention execution. </param> | ||
void ProcessSkipNavigationRemoved( | ||
[NotNull] IConventionEntityTypeBuilder entityTypeBuilder, | ||
[NotNull] IConventionSkipNavigation navigation, | ||
[NotNull] IConventionContext<IConventionSkipNavigation> context); | ||
} | ||
} |
Oops, something went wrong.