From 45d17a3d00771ad665380eb9a16089ae05b22258 Mon Sep 17 00:00:00 2001 From: Andriy Svyryd Date: Wed, 22 Jul 2020 13:52:55 -0700 Subject: [PATCH] Remove IIndexNameChangedConvention --- .../Metadata/Conventions/ConventionSet.cs | 6 ----- .../IIndexNameChangedConvention.cs | 23 ------------------ .../Conventions/ConventionDispatcherTest.cs | 24 ------------------- 3 files changed, 53 deletions(-) delete mode 100644 src/EFCore/Metadata/Conventions/IIndexNameChangedConvention.cs diff --git a/src/EFCore/Metadata/Conventions/ConventionSet.cs b/src/EFCore/Metadata/Conventions/ConventionSet.cs index 4ef12321184..5969000e213 100644 --- a/src/EFCore/Metadata/Conventions/ConventionSet.cs +++ b/src/EFCore/Metadata/Conventions/ConventionSet.cs @@ -199,12 +199,6 @@ public class ConventionSet public virtual IList IndexUniquenessChangedConventions { get; } = new List(); - /// - /// Conventions to run when the name of an index is changed. - /// - public virtual IList IndexNameChangedConventions { get; } - = new List(); - /// /// Conventions to run when an annotation is changed on an index. /// diff --git a/src/EFCore/Metadata/Conventions/IIndexNameChangedConvention.cs b/src/EFCore/Metadata/Conventions/IIndexNameChangedConvention.cs deleted file mode 100644 index 3a90e68ffd3..00000000000 --- a/src/EFCore/Metadata/Conventions/IIndexNameChangedConvention.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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 -{ - /// - /// Represents an operation that should be performed when the name of an index is changed. - /// - public interface IIndexNameChangedConvention : IConvention - { - /// - /// Called after the name of an index is changed. - /// - /// The builder for the index. - /// Additional information associated with convention execution. - void ProcessIndexNameChanged( - [NotNull] IConventionIndexBuilder indexBuilder, - [NotNull] IConventionContext context); - } -} diff --git a/test/EFCore.Tests/Metadata/Conventions/ConventionDispatcherTest.cs b/test/EFCore.Tests/Metadata/Conventions/ConventionDispatcherTest.cs index 59253a820c8..11110e12509 100644 --- a/test/EFCore.Tests/Metadata/Conventions/ConventionDispatcherTest.cs +++ b/test/EFCore.Tests/Metadata/Conventions/ConventionDispatcherTest.cs @@ -2812,30 +2812,6 @@ public void ProcessIndexUniquenessChanged( } } - private class IndexNameChangedConvention : IIndexNameChangedConvention - { - private readonly bool _terminate; - public readonly List Calls = new List(); - - public IndexNameChangedConvention(bool terminate) - { - _terminate = terminate; - } - - public void ProcessIndexNameChanged( - IConventionIndexBuilder indexBuilder, IConventionContext context) - { - Assert.NotNull(indexBuilder.Metadata.Builder); - - Calls.Add(indexBuilder.Metadata.Name); - - if (_terminate) - { - context.StopProcessing(); - } - } - } - [InlineData(false, false)] [InlineData(true, false)] [InlineData(false, true)]