Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove internal notification indirection #15694

Merged
merged 1 commit into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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