Skip to content

Commit

Permalink
Remove internal notification indirection
Browse files Browse the repository at this point in the history
Fixes #10897

This was added years ago to support multiple dispatch, but we don't use it and it's internal, so removing.
  • Loading branch information
ajcvickers committed May 13, 2019
1 parent 716f015 commit 2daec6a
Show file tree
Hide file tree
Showing 15 changed files with 234 additions and 474 deletions.
19 changes: 18 additions & 1 deletion src/EFCore/ChangeTracking/Internal/IChangeDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal
Expand All @@ -20,8 +21,24 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal
/// The implementation does not need to be thread-safe.
/// </para>
/// </summary>
public interface IChangeDetector : IPropertyListener
public interface IChangeDetector
{
/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void PropertyChanged([NotNull] InternalEntityEntry entry, [NotNull] IPropertyBase propertyBase, bool setModified);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void PropertyChanging([NotNull] InternalEntityEntry entry, [NotNull] IPropertyBase propertyBase);

/// <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
47 changes: 0 additions & 47 deletions src/EFCore/ChangeTracking/Internal/IEntityStateListener.cs

This file was deleted.

42 changes: 0 additions & 42 deletions src/EFCore/ChangeTracking/Internal/IKeyListener.cs

This file was deleted.

21 changes: 20 additions & 1 deletion src/EFCore/ChangeTracking/Internal/ILocalViewListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal
/// The implementation does not need to be thread-safe.
/// </para>
/// </summary>
public interface ILocalViewListener : IEntityStateListener
public interface ILocalViewListener
{
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand All @@ -30,5 +30,24 @@ public interface ILocalViewListener : IEntityStateListener
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void RegisterView([NotNull] Action<InternalEntityEntry, EntityState> viewAction);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void StateChanging([NotNull] InternalEntityEntry entry, EntityState newState);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void StateChanged(
[NotNull] InternalEntityEntry entry,
EntityState oldState,
bool fromQuery);
}
}
71 changes: 70 additions & 1 deletion src/EFCore/ChangeTracking/Internal/INavigationFixer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// 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.Collections.Generic;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal
Expand All @@ -19,7 +22,73 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal
/// The implementation does not need to be thread-safe.
/// </para>
/// </summary>
public interface INavigationFixer : IEntityStateListener, INavigationListener, IKeyListener, IQueryTrackingListener
public interface INavigationFixer
{
/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void NavigationReferenceChanged(
[NotNull] InternalEntityEntry entry,
[NotNull] INavigation navigation,
[CanBeNull] object oldValue,
[CanBeNull] object newValue);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void NavigationCollectionChanged(
[NotNull] InternalEntityEntry entry,
[NotNull] INavigation navigation,
[NotNull] IEnumerable<object> added,
[NotNull] IEnumerable<object> removed);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void TrackedFromQuery(
[NotNull] InternalEntityEntry entry,
[CanBeNull] ISet<IForeignKey> handledForeignKeys);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void KeyPropertyChanged(
[NotNull] InternalEntityEntry entry,
[NotNull] IProperty property,
[NotNull] IReadOnlyList<IKey> containingPrincipalKeys,
[NotNull] IReadOnlyList<IForeignKey> containingForeignKeys,
[CanBeNull] object oldValue,
[CanBeNull] object newValue);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void StateChanging([NotNull] InternalEntityEntry entry, EntityState newState);

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void StateChanged(
[NotNull] InternalEntityEntry entry,
EntityState oldState,
bool fromQuery);
}
}
52 changes: 0 additions & 52 deletions src/EFCore/ChangeTracking/Internal/INavigationListener.cs

This file was deleted.

43 changes: 0 additions & 43 deletions src/EFCore/ChangeTracking/Internal/IPropertyListener.cs

This file was deleted.

Loading

0 comments on commit 2daec6a

Please sign in to comment.