diff --git a/src/EFCore/ChangeTracking/ChangeTracker.cs b/src/EFCore/ChangeTracking/ChangeTracker.cs
index d650a9383f9..da8aa7835b4 100644
--- a/src/EFCore/ChangeTracking/ChangeTracker.cs
+++ b/src/EFCore/ChangeTracking/ChangeTracker.cs
@@ -196,10 +196,10 @@ private void TryDetectChanges()
///
///
/// Note that this method calls unless
- /// has been set to .
+ /// has been set to .
///
///
- /// if there are changes to save, otherwise .
+ /// if there are changes to save, otherwise .
public virtual bool HasChanges()
{
TryDetectChanges();
@@ -231,7 +231,8 @@ public virtual void DetectChanges()
/// represent the current state of the database. This method is typically called by
/// after changes have been successfully saved to the database.
///
- public virtual void AcceptAllChanges() => StateManager.AcceptAllChanges();
+ public virtual void AcceptAllChanges()
+ => StateManager.AcceptAllChanges();
///
///
@@ -402,7 +403,7 @@ Task IResettableService.ResetStateAsync(CancellationToken cancellationToken)
/// Stops tracking all currently tracked entities.
///
///
- /// is designed to have a short lifetime where a new instance is created for each unit-of-work.
+ /// is designed to have a short lifetime where a new instance is created for each unit-of-work.
/// This manner means all tracked entities are discarded when the context is disposed at the end of each unit-of-work.
/// However, clearing all tracked entities using this method may be useful in situations where creating a new context
/// instance is not practical.
@@ -413,7 +414,7 @@ Task IResettableService.ResetStateAsync(CancellationToken cancellationToken)
/// This method is much more efficient at clearing all tracked entities from the context.
///
///
- /// Note that this method does not generate events since entities are not individually detached.
+ /// Note that this method does not generate events since entities are not individually detached.
///
///
public virtual void Clear()
@@ -440,22 +441,25 @@ public virtual DebugView DebugView
///
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/ChangeTracking/ChangeTrackerExtensions.cs b/src/EFCore/ChangeTracking/ChangeTrackerExtensions.cs
index 8d27c457aea..87db70ecb50 100644
--- a/src/EFCore/ChangeTracking/ChangeTrackerExtensions.cs
+++ b/src/EFCore/ChangeTracking/ChangeTrackerExtensions.cs
@@ -51,7 +51,7 @@ public static string ToDebugString(
private sealed class EntityEntryComparer : IComparer
{
- public static EntityEntryComparer Instance = new EntityEntryComparer();
+ public static readonly EntityEntryComparer Instance = new EntityEntryComparer();
public int Compare(InternalEntityEntry x, InternalEntityEntry y)
{
@@ -79,6 +79,5 @@ public int Compare(InternalEntityEntry x, InternalEntityEntry y)
return 0;
}
}
-
}
}
diff --git a/src/EFCore/ChangeTracking/CollectionEntry`.cs b/src/EFCore/ChangeTracking/CollectionEntry`.cs
index cac937c6ec0..3e3842970c2 100644
--- a/src/EFCore/ChangeTracking/CollectionEntry`.cs
+++ b/src/EFCore/ChangeTracking/CollectionEntry`.cs
@@ -54,7 +54,8 @@ public CollectionEntry([NotNull] InternalEntityEntry internalEntry, [NotNull] IN
/// The to which this member belongs.
///
/// An entry for the entity that owns this member.
- public new virtual EntityEntry EntityEntry => new EntityEntry(InternalEntry);
+ public new virtual EntityEntry EntityEntry
+ => new EntityEntry(InternalEntry);
///
/// Gets or sets the value currently assigned to this property. If the current value is set using this property,
diff --git a/src/EFCore/ChangeTracking/EntityEntry.cs b/src/EFCore/ChangeTracking/EntityEntry.cs
index 7c975caa4e2..5e932a4cebf 100644
--- a/src/EFCore/ChangeTracking/EntityEntry.cs
+++ b/src/EFCore/ChangeTracking/EntityEntry.cs
@@ -61,7 +61,8 @@ public EntityEntry([NotNull] InternalEntityEntry internalEntry)
///
/// Gets the entity being tracked by this entry.
///
- public virtual object Entity => InternalEntry.Entity;
+ public virtual object Entity
+ => InternalEntry.Entity;
///
///
@@ -114,17 +115,20 @@ public virtual void DetectChanges()
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- InternalEntityEntry IInfrastructure.Instance => InternalEntry;
+ InternalEntityEntry IInfrastructure.Instance
+ => InternalEntry;
///
/// Gets the context that is tracking the entity.
///
- public virtual DbContext Context => InternalEntry.StateManager.Context;
+ public virtual DbContext Context
+ => InternalEntry.StateManager.Context;
///
/// Gets the metadata about the shape of the entity, its relationships to other entities, and how it maps to the database.
///
- public virtual IEntityType Metadata => InternalEntry.EntityType;
+ public virtual IEntityType Metadata
+ => InternalEntry.EntityType;
///
/// Provides access to change tracking information and operations for a given
@@ -286,7 +290,8 @@ public virtual IEnumerable Collections
/// true since any value is considered a valid key value.
///
///
- public virtual bool IsKeySet => InternalEntry.IsKeySet.IsSet;
+ public virtual bool IsKeySet
+ => InternalEntry.IsKeySet.IsSet;
///
/// Gets the current property values for this entity.
@@ -372,7 +377,8 @@ public virtual async Task GetDatabaseValuesAsync(CancellationTok
/// not yet have had its permanent key value created.
///
///
- public virtual void Reload() => Reload(GetDatabaseValues());
+ public virtual void Reload()
+ => Reload(GetDatabaseValues());
///
///
@@ -420,7 +426,8 @@ private IEntityFinder Finder
/// Returns a string that represents the current object.
///
/// A string that represents the current object.
- public override string ToString() => InternalEntry.ToString();
+ public override string ToString()
+ => InternalEntry.ToString();
///
///
@@ -442,16 +449,18 @@ public virtual DebugView DebugView
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/ChangeTracking/EntityEntryEventArgs.cs b/src/EFCore/ChangeTracking/EntityEntryEventArgs.cs
index 4233f723395..59eb18e443e 100644
--- a/src/EFCore/ChangeTracking/EntityEntryEventArgs.cs
+++ b/src/EFCore/ChangeTracking/EntityEntryEventArgs.cs
@@ -32,6 +32,7 @@ public EntityEntryEventArgs(
///
/// The for the entity.
///
- public virtual EntityEntry Entry => _entry ??= new EntityEntry(_internalEntityEntry);
+ public virtual EntityEntry Entry
+ => _entry ??= new EntityEntry(_internalEntityEntry);
}
}
diff --git a/src/EFCore/ChangeTracking/EntityEntryGraphNode.cs b/src/EFCore/ChangeTracking/EntityEntryGraphNode.cs
index eee90782d44..5057ae49b95 100644
--- a/src/EFCore/ChangeTracking/EntityEntryGraphNode.cs
+++ b/src/EFCore/ChangeTracking/EntityEntryGraphNode.cs
@@ -42,7 +42,8 @@ public EntityEntryGraphNode(
///
/// Gets the entry tracking information about this entity.
///
- public virtual EntityEntry SourceEntry => _sourceEntry == null ? null : new EntityEntry(_sourceEntry);
+ public virtual EntityEntry SourceEntry
+ => _sourceEntry == null ? null : new EntityEntry(_sourceEntry);
///
/// Gets the navigation property that is being traversed to reach this node in the graph.
@@ -52,7 +53,8 @@ public EntityEntryGraphNode(
///
/// Gets the entry tracking information about this entity.
///
- public virtual EntityEntry Entry => new EntityEntry(_entry);
+ public virtual EntityEntry Entry
+ => new EntityEntry(_entry);
///
///
@@ -63,7 +65,8 @@ public EntityEntryGraphNode(
/// application code.
///
///
- InternalEntityEntry IInfrastructure.Instance => _entry;
+ InternalEntityEntry IInfrastructure.Instance
+ => _entry;
///
/// Creates a new node for the entity that is being traversed next in the graph.
diff --git a/src/EFCore/ChangeTracking/EntityEntry`.cs b/src/EFCore/ChangeTracking/EntityEntry`.cs
index 050e3a09b72..9d604c845ff 100644
--- a/src/EFCore/ChangeTracking/EntityEntry`.cs
+++ b/src/EFCore/ChangeTracking/EntityEntry`.cs
@@ -42,7 +42,8 @@ public EntityEntry([NotNull] InternalEntityEntry internalEntry)
///
/// Gets the entity being tracked by this entry.
///
- public new virtual TEntity Entity => (TEntity)base.Entity;
+ public new virtual TEntity Entity
+ => (TEntity)base.Entity;
///
/// Provides access to change tracking information and operations for a given
diff --git a/src/EFCore/ChangeTracking/EntryCurrentValueComparer`.cs b/src/EFCore/ChangeTracking/EntryCurrentValueComparer`.cs
index 0392df1a60c..b4c94b1f6fb 100644
--- a/src/EFCore/ChangeTracking/EntryCurrentValueComparer`.cs
+++ b/src/EFCore/ChangeTracking/EntryCurrentValueComparer`.cs
@@ -51,7 +51,7 @@ public int Compare(IUpdateEntry x, IUpdateEntry y)
///
/// The first object to compare.
/// The second object to compare.
- /// if the specified objects are equal; otherwise, .
+ /// if the specified objects are equal; otherwise, .
public bool Equals(IUpdateEntry x, IUpdateEntry y)
=> Compare(x, y) == 0;
diff --git a/src/EFCore/ChangeTracking/IDependentKeyValueFactory.cs b/src/EFCore/ChangeTracking/IDependentKeyValueFactory.cs
index fe2e4a30154..9dbba4a6398 100644
--- a/src/EFCore/ChangeTracking/IDependentKeyValueFactory.cs
+++ b/src/EFCore/ChangeTracking/IDependentKeyValueFactory.cs
@@ -25,7 +25,7 @@ public interface IDependentKeyValueFactory
///
/// The value buffer representing the entity instance.
/// The key instance.
- /// if the key instance was created; otherwise.
+ /// if the key instance was created; otherwise.
[ContractAnnotation("=>true, key:notnull; =>false, key:null")]
bool TryCreateFromBuffer(in ValueBuffer valueBuffer, out TKey key);
@@ -34,7 +34,7 @@ public interface IDependentKeyValueFactory
///
/// The entry tracking an entity instance.
/// The key instance.
- /// if the key instance was created; otherwise.
+ /// if the key instance was created; otherwise.
[ContractAnnotation("=>true, key:notnull; =>false, key:null")]
bool TryCreateFromCurrentValues([NotNull] IUpdateEntry entry, out TKey key);
@@ -44,7 +44,7 @@ public interface IDependentKeyValueFactory
///
/// The entry tracking an entity instance.
/// The key instance.
- /// if the key instance was created; otherwise.
+ /// if the key instance was created; otherwise.
[ContractAnnotation("=>true, key:notnull; =>false, key:null")]
bool TryCreateFromPreStoreGeneratedCurrentValues([NotNull] IUpdateEntry entry, out TKey key);
@@ -53,7 +53,7 @@ public interface IDependentKeyValueFactory
///
/// The entry tracking an entity instance.
/// The key instance.
- /// if the key instance was created; otherwise.
+ /// if the key instance was created; otherwise.
[ContractAnnotation("=>true, key:notnull; =>false, key:null")]
bool TryCreateFromOriginalValues([NotNull] IUpdateEntry entry, out TKey key);
@@ -63,7 +63,7 @@ public interface IDependentKeyValueFactory
///
/// The entry tracking an entity instance.
/// The key instance.
- /// if the key instance was created; otherwise.
+ /// if the key instance was created; otherwise.
[ContractAnnotation("=>true, key:notnull; =>false, key:null")]
bool TryCreateFromRelationshipSnapshot([NotNull] IUpdateEntry entry, out TKey key);
diff --git a/src/EFCore/ChangeTracking/Internal/ArrayPropertyValues.cs b/src/EFCore/ChangeTracking/Internal/ArrayPropertyValues.cs
index b0cd3685fb8..3a15368e0d9 100644
--- a/src/EFCore/ChangeTracking/Internal/ArrayPropertyValues.cs
+++ b/src/EFCore/ChangeTracking/Internal/ArrayPropertyValues.cs
@@ -7,7 +7,6 @@
using System.Reflection;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Diagnostics;
-using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Query;
@@ -34,7 +33,8 @@ public class ArrayPropertyValues : PropertyValues
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public ArrayPropertyValues([NotNull] InternalEntityEntry internalEntry, [NotNull] object[] values)
- : base(internalEntry) => _values = values;
+ : base(internalEntry)
+ => _values = values;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs b/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs
index 84508474c90..f1968310e7e 100644
--- a/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs
+++ b/src/EFCore/ChangeTracking/Internal/ChangeDetector.cs
@@ -1,7 +1,6 @@
// 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;
using System.Collections.Generic;
using System.Linq;
@@ -55,7 +54,8 @@ public ChangeDetector(
/// 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.
///
- public virtual void Suspend() => _suspended = true;
+ public virtual void Suspend()
+ => _suspended = true;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -63,7 +63,8 @@ public ChangeDetector(
/// 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.
///
- public virtual void Resume() => _suspended = false;
+ public virtual void Resume()
+ => _suspended = false;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/CurrentValueComparerFactory.cs b/src/EFCore/ChangeTracking/Internal/CurrentValueComparerFactory.cs
index 0596ec37e45..5225104e2d2 100644
--- a/src/EFCore/ChangeTracking/Internal/CurrentValueComparerFactory.cs
+++ b/src/EFCore/ChangeTracking/Internal/CurrentValueComparerFactory.cs
@@ -81,7 +81,7 @@ public virtual IComparer Create([NotNull] IPropertyBase propertyBa
propertyBase.DeclaringType.DisplayName(),
propertyBase.Name,
modelType.ShortDisplayName(),
- providerType.ShortDisplayName() ));
+ providerType.ShortDisplayName()));
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/EmptyShadowValuesFactoryFactory.cs b/src/EFCore/ChangeTracking/Internal/EmptyShadowValuesFactoryFactory.cs
index ac63a6131f0..f2161dbcbbf 100644
--- a/src/EFCore/ChangeTracking/Internal/EmptyShadowValuesFactoryFactory.cs
+++ b/src/EFCore/ChangeTracking/Internal/EmptyShadowValuesFactoryFactory.cs
@@ -48,7 +48,8 @@ protected override ValueComparer GetValueComparer(IProperty property)
/// 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.
///
- protected override bool UseEntityVariable => false;
+ protected override bool UseEntityVariable
+ => false;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs b/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs
index b723165e6b1..fd2773b413f 100644
--- a/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs
+++ b/src/EFCore/ChangeTracking/Internal/EntityEntryGraphIterator.cs
@@ -109,9 +109,9 @@ public virtual async Task TraverseGraphAsync(
{
var targetEntry = stateManager.GetOrCreateEntry(relatedEntity, targetType);
await TraverseGraphAsync(
- (EntityEntryGraphNode)node.CreateNode(node, targetEntry, navigation),
- handleNode,
- cancellationToken)
+ (EntityEntryGraphNode)node.CreateNode(node, targetEntry, navigation),
+ handleNode,
+ cancellationToken)
.ConfigureAwait(false);
}
}
@@ -119,9 +119,9 @@ await TraverseGraphAsync(
{
var targetEntry = stateManager.GetOrCreateEntry(navigationValue, targetType);
await TraverseGraphAsync(
- (EntityEntryGraphNode)node.CreateNode(node, targetEntry, navigation),
- handleNode,
- cancellationToken)
+ (EntityEntryGraphNode)node.CreateNode(node, targetEntry, navigation),
+ handleNode,
+ cancellationToken)
.ConfigureAwait(false);
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs b/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs
index d0a405a4451..d7d5d9b16d1 100644
--- a/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs
+++ b/src/EFCore/ChangeTracking/Internal/EntityGraphAttacher.cs
@@ -34,7 +34,8 @@ public class EntityGraphAttacher : IEntityGraphAttacher
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public EntityGraphAttacher(
- [NotNull] IEntityEntryGraphIterator graphIterator) => _graphIterator = graphIterator;
+ [NotNull] IEntityEntryGraphIterator graphIterator)
+ => _graphIterator = graphIterator;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/EntityReferenceMap.cs b/src/EFCore/ChangeTracking/Internal/EntityReferenceMap.cs
index 836774ecf4d..c03bbe187e8 100644
--- a/src/EFCore/ChangeTracking/Internal/EntityReferenceMap.cs
+++ b/src/EFCore/ChangeTracking/Internal/EntityReferenceMap.cs
@@ -85,7 +85,8 @@ public virtual void Update(
_detachedReferenceMap[mapKey] = entry;
break;
case EntityState.Unchanged:
- _unchangedReferenceMap ??= new Dictionary
InternalEntityEntry TryGetEntryUsingPreStoreGeneratedValues(
- [NotNull] IForeignKey foreignKey, [NotNull] InternalEntityEntry dependentEntry);
+ [NotNull] IForeignKey foreignKey,
+ [NotNull] InternalEntityEntry dependentEntry);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -79,7 +80,8 @@ InternalEntityEntry TryGetEntryUsingPreStoreGeneratedValues(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
InternalEntityEntry TryGetEntryUsingRelationshipSnapshot(
- [NotNull] IForeignKey foreignKey, [NotNull] InternalEntityEntry dependentEntry);
+ [NotNull] IForeignKey foreignKey,
+ [NotNull] InternalEntityEntry dependentEntry);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/IStateManager.cs b/src/EFCore/ChangeTracking/Internal/IStateManager.cs
index e785ad20f1d..01f61126867 100644
--- a/src/EFCore/ChangeTracking/Internal/IStateManager.cs
+++ b/src/EFCore/ChangeTracking/Internal/IStateManager.cs
@@ -260,7 +260,9 @@ IEnumerable GetNonDeletedEntities()
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
void RecordReferencedUntrackedEntity(
- [NotNull] object referencedEntity, [NotNull] INavigationBase navigation, [NotNull] InternalEntityEntry referencedFromEntry);
+ [NotNull] object referencedEntity,
+ [NotNull] INavigationBase navigation,
+ [NotNull] InternalEntityEntry referencedFromEntry);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -285,7 +287,8 @@ void RecordReferencedUntrackedEntity(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
InternalEntityEntry FindPrincipalUsingPreStoreGeneratedValues(
- [NotNull] InternalEntityEntry dependentEntry, [NotNull] IForeignKey foreignKey);
+ [NotNull] InternalEntityEntry dependentEntry,
+ [NotNull] IForeignKey foreignKey);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -294,7 +297,8 @@ InternalEntityEntry FindPrincipalUsingPreStoreGeneratedValues(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
InternalEntityEntry FindPrincipalUsingRelationshipSnapshot(
- [NotNull] InternalEntityEntry dependentEntry, [NotNull] IForeignKey foreignKey);
+ [NotNull] InternalEntityEntry dependentEntry,
+ [NotNull] IForeignKey foreignKey);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -319,7 +323,8 @@ InternalEntityEntry FindPrincipalUsingRelationshipSnapshot(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
IEnumerable GetDependentsFromNavigation(
- [NotNull] IUpdateEntry principalEntry, [NotNull] IForeignKey foreignKey);
+ [NotNull] IUpdateEntry principalEntry,
+ [NotNull] IForeignKey foreignKey);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -336,7 +341,8 @@ IEnumerable GetDependentsFromNavigation(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
IEnumerable GetDependentsUsingRelationshipSnapshot(
- [NotNull] IUpdateEntry principalEntry, [NotNull] IForeignKey foreignKey);
+ [NotNull] IUpdateEntry principalEntry,
+ [NotNull] IForeignKey foreignKey);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/IdentityMap.cs b/src/EFCore/ChangeTracking/Internal/IdentityMap.cs
index 94f4f1b233c..ff260eb0677 100644
--- a/src/EFCore/ChangeTracking/Internal/IdentityMap.cs
+++ b/src/EFCore/ChangeTracking/Internal/IdentityMap.cs
@@ -175,7 +175,8 @@ public virtual InternalEntityEntry TryGetEntry(IForeignKey foreignKey, InternalE
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual InternalEntityEntry TryGetEntryUsingPreStoreGeneratedValues(
- IForeignKey foreignKey, InternalEntityEntry dependentEntry)
+ IForeignKey foreignKey,
+ InternalEntityEntry dependentEntry)
=> foreignKey.GetDependentKeyValueFactory().TryCreateFromPreStoreGeneratedCurrentValues(dependentEntry, out var key)
&& _identityMap.TryGetValue(key, out var entry)
? entry
diff --git a/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs b/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs
index dccb6f7ad2d..f32feffaf9f 100644
--- a/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs
+++ b/src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs
@@ -167,7 +167,10 @@ await StateManager.ValueGenerationManager.GenerateAsync(this, cancellationToken)
}
private EntityState PropagateToUnknownKey(
- EntityState oldState, EntityState entityState, bool adding, EntityState? forceStateWhenUnknownKey)
+ EntityState oldState,
+ EntityState entityState,
+ bool adding,
+ EntityState? forceStateWhenUnknownKey)
{
var keyUnknown = IsKeyUnknown;
@@ -401,7 +404,8 @@ public virtual void MarkUnchangedFromQuery()
/// 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.
///
- public virtual EntityState EntityState => _stateData.EntityState;
+ public virtual EntityState EntityState
+ => _stateData.EntityState;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -666,7 +670,8 @@ internal static readonly MethodInfo ReadShadowValueMethod
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[UsedImplicitly]
- protected virtual T ReadShadowValue(int shadowIndex) => default;
+ protected virtual T ReadShadowValue(int shadowIndex)
+ => default;
internal static readonly MethodInfo ReadOriginalValueMethod
= typeof(InternalEntityEntry).GetTypeInfo().GetDeclaredMethod(nameof(ReadOriginalValue));
@@ -878,7 +883,9 @@ public virtual object GetRelationshipSnapshotValue(IPropertyBase propertyBase)
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual void SetOriginalValue(
- [NotNull] IPropertyBase propertyBase, [CanBeNull] object value, int index = -1)
+ [NotNull] IPropertyBase propertyBase,
+ [CanBeNull] object value,
+ int index = -1)
{
EnsureOriginalValues();
@@ -976,7 +983,8 @@ public virtual void EnsureRelationshipSnapshot()
/// 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.
///
- public virtual bool HasOriginalValuesSnapshot => !_originalValues.IsEmpty;
+ public virtual bool HasOriginalValuesSnapshot
+ => !_originalValues.IsEmpty;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -984,7 +992,8 @@ public virtual void EnsureRelationshipSnapshot()
/// 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.
///
- public virtual bool HasRelationshipSnapshot => !_relationshipsSnapshot.IsEmpty;
+ public virtual bool HasRelationshipSnapshot
+ => !_relationshipsSnapshot.IsEmpty;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -1032,7 +1041,7 @@ public virtual void AddRangeToCollectionSnapshot(
/// 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.
///
- public object this[[NotNull] IPropertyBase propertyBase] // Intentionally non-virtual
+ public object this[[NotNull] IPropertyBase propertyBase] // Intentionally non-virtual
{
get
{
@@ -1580,7 +1589,8 @@ public virtual bool IsKeyUnknown
/// 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.
///
- public virtual EntityEntry ToEntityEntry() => new EntityEntry(this);
+ public virtual EntityEntry ToEntityEntry()
+ => new EntityEntry(this);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -1714,7 +1724,8 @@ public virtual DebugView DebugView
() => this.ToDebugString(ChangeTrackerDebugStringOptions.ShortDefault),
() => this.ToDebugString(ChangeTrackerDebugStringOptions.LongDefault));
- IUpdateEntry IUpdateEntry.SharedIdentityEntry => SharedIdentityEntry;
+ IUpdateEntry IUpdateEntry.SharedIdentityEntry
+ => SharedIdentityEntry;
private enum CurrentValueType
{
diff --git a/src/EFCore/ChangeTracking/Internal/InternalEntityEntryFactory.cs b/src/EFCore/ChangeTracking/Internal/InternalEntityEntryFactory.cs
index 9c2ea3287c4..8a61aa9c1d5 100644
--- a/src/EFCore/ChangeTracking/Internal/InternalEntityEntryFactory.cs
+++ b/src/EFCore/ChangeTracking/Internal/InternalEntityEntryFactory.cs
@@ -40,7 +40,10 @@ public virtual InternalEntityEntry Create(IStateManager stateManager, IEntityTyp
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual InternalEntityEntry Create(
- IStateManager stateManager, IEntityType entityType, object entity, in ValueBuffer valueBuffer)
+ IStateManager stateManager,
+ IEntityType entityType,
+ object entity,
+ in ValueBuffer valueBuffer)
=> NewInternalEntityEntry(stateManager, entityType, entity, valueBuffer);
private static InternalEntityEntry NewInternalEntityEntry(IStateManager stateManager, IEntityType entityType, object entity)
diff --git a/src/EFCore/ChangeTracking/Internal/InternalShadowEntityEntry.cs b/src/EFCore/ChangeTracking/Internal/InternalShadowEntityEntry.cs
index 6643f668051..1abedb85ddf 100644
--- a/src/EFCore/ChangeTracking/Internal/InternalShadowEntityEntry.cs
+++ b/src/EFCore/ChangeTracking/Internal/InternalShadowEntityEntry.cs
@@ -26,7 +26,8 @@ public class InternalShadowEntityEntry : InternalEntityEntry
/// 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.
///
- public override object Entity => null;
+ public override object Entity
+ => null;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
diff --git a/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs b/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs
index 48f62f1c39a..47d28511092 100644
--- a/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs
+++ b/src/EFCore/ChangeTracking/Internal/NavigationFixer.cs
@@ -54,7 +54,10 @@ public NavigationFixer(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual void NavigationReferenceChanged(
- InternalEntityEntry entry, INavigationBase navigationBase, object oldValue, object newValue)
+ InternalEntityEntry entry,
+ INavigationBase navigationBase,
+ object oldValue,
+ object newValue)
{
if (_inFixup)
{
@@ -97,7 +100,8 @@ public virtual void NavigationReferenceChanged(
// null out its FKs and navigation property. A.k.a. reference stealing.
// However, if the FK has already been changed or the reference is already set to point
// to something else, then don't change it.
- var victimDependentEntry = (InternalEntityEntry)stateManager.GetDependents(newTargetEntry, foreignKey).FirstOrDefault();
+ var victimDependentEntry =
+ (InternalEntityEntry)stateManager.GetDependents(newTargetEntry, foreignKey).FirstOrDefault();
if (victimDependentEntry != null
&& victimDependentEntry != entry)
{
@@ -412,7 +416,8 @@ public virtual void KeyPropertyChanged(
// However, if the FK has already been changed or the reference is already set to point
// to something else, then don't change it.
var targetDependentEntry
- = (InternalEntityEntry)stateManager.GetDependentsUsingRelationshipSnapshot(newPrincipalEntry, foreignKey).FirstOrDefault();
+ = (InternalEntityEntry)stateManager
+ .GetDependentsUsingRelationshipSnapshot(newPrincipalEntry, foreignKey).FirstOrDefault();
if (targetDependentEntry != null
&& targetDependentEntry != entry)
@@ -875,7 +880,10 @@ private void InitialFixup(
}
private void DelayedFixup(
- InternalEntityEntry entry, INavigationBase navigationBase, InternalEntityEntry referencedEntry, bool fromQuery)
+ InternalEntityEntry entry,
+ INavigationBase navigationBase,
+ InternalEntityEntry referencedEntry,
+ bool fromQuery)
{
var navigationValue = entry[navigationBase];
@@ -929,8 +937,11 @@ private void DelayedFixup(
}
private static InternalEntityEntry FindOrCreateJoinEntry(
- InternalEntityEntry entry, InternalEntityEntry otherEntry, ISkipNavigation skipNavigation,
- bool fromQuery, bool setModified)
+ InternalEntityEntry entry,
+ InternalEntityEntry otherEntry,
+ ISkipNavigation skipNavigation,
+ bool fromQuery,
+ bool setModified)
{
var joinEntry = FindJoinEntry(entry, otherEntry, skipNavigation);
@@ -1030,11 +1041,13 @@ bool TryFind(
var key = joinEntityType.FindKey(new[] { firstForeignKey.Properties[0], secondForeignKey.Properties[0] });
if (key != null)
{
- joinEntry = entry.StateManager.TryGetEntry(key, new[]
- {
- firstEntry[firstForeignKey.PrincipalKey.Properties[0]],
- secondEntry[secondForeignKey.PrincipalKey.Properties[0]]
- });
+ joinEntry = entry.StateManager.TryGetEntry(
+ key,
+ new[]
+ {
+ firstEntry[firstForeignKey.PrincipalKey.Properties[0]],
+ secondEntry[secondForeignKey.PrincipalKey.Properties[0]]
+ });
return true;
}
@@ -1114,7 +1127,8 @@ private void ToDependentFixup(
var oldDependentEntry = oldDependent != null
&& !ReferenceEquals(dependentEntry.Entity, oldDependent)
? dependentEntry.StateManager.TryGetEntry(oldDependent, foreignKey.DeclaringEntityType)
- : (InternalEntityEntry)dependentEntry.StateManager.GetDependentsUsingRelationshipSnapshot(principalEntry, foreignKey)
+ : (InternalEntityEntry)dependentEntry.StateManager
+ .GetDependentsUsingRelationshipSnapshot(principalEntry, foreignKey)
.FirstOrDefault();
if (oldDependentEntry != null
diff --git a/src/EFCore/ChangeTracking/Internal/OriginalValues.cs b/src/EFCore/ChangeTracking/Internal/OriginalValues.cs
index c07b4b789b1..e467209b2b9 100644
--- a/src/EFCore/ChangeTracking/Internal/OriginalValues.cs
+++ b/src/EFCore/ChangeTracking/Internal/OriginalValues.cs
@@ -3,7 +3,6 @@
using System;
using Microsoft.EntityFrameworkCore.Diagnostics;
-using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Utilities;
@@ -111,7 +110,8 @@ private static object SnapshotValue(IProperty property, object value)
return comparer == null ? value : comparer.Snapshot(value);
}
- public bool IsEmpty => _values == null;
+ public bool IsEmpty
+ => _values == null;
}
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/RelationshipsSnapshot.cs b/src/EFCore/ChangeTracking/Internal/RelationshipsSnapshot.cs
index 2ffb92b7fc6..75e5239bd8c 100644
--- a/src/EFCore/ChangeTracking/Internal/RelationshipsSnapshot.cs
+++ b/src/EFCore/ChangeTracking/Internal/RelationshipsSnapshot.cs
@@ -108,7 +108,8 @@ private HashSet GetOrCreateCollection(int index)
return snapshot;
}
- public bool IsEmpty => _values == null;
+ public bool IsEmpty
+ => _values == null;
}
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/ShadowValuesFactoryFactory.cs b/src/EFCore/ChangeTracking/Internal/ShadowValuesFactoryFactory.cs
index be1621aa3ee..b6547e1f71a 100644
--- a/src/EFCore/ChangeTracking/Internal/ShadowValuesFactoryFactory.cs
+++ b/src/EFCore/ChangeTracking/Internal/ShadowValuesFactoryFactory.cs
@@ -50,7 +50,8 @@ protected override ValueComparer GetValueComparer(IProperty property)
/// 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.
///
- protected override bool UseEntityVariable => false;
+ protected override bool UseEntityVariable
+ => false;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -59,7 +60,8 @@ protected override ValueComparer GetValueComparer(IProperty property)
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
protected override Expression CreateReadShadowValueExpression(
- ParameterExpression parameter, IPropertyBase property)
+ ParameterExpression parameter,
+ IPropertyBase property)
=> Expression.Convert(
Expression.Call(
parameter,
@@ -74,7 +76,8 @@ protected override Expression CreateReadShadowValueExpression(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
protected override Expression CreateReadValueExpression(
- ParameterExpression parameter, IPropertyBase property)
+ ParameterExpression parameter,
+ IPropertyBase property)
=> CreateReadShadowValueExpression(parameter, property);
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/SidecarValues.cs b/src/EFCore/ChangeTracking/Internal/SidecarValues.cs
index a06ed108bfe..c4cc484490e 100644
--- a/src/EFCore/ChangeTracking/Internal/SidecarValues.cs
+++ b/src/EFCore/ChangeTracking/Internal/SidecarValues.cs
@@ -3,7 +3,6 @@
using System;
using Microsoft.EntityFrameworkCore.Diagnostics;
-using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Utilities;
@@ -57,7 +56,8 @@ private static object SnapshotValue(IProperty property, object value)
return comparer == null ? value : comparer.Snapshot(value);
}
- public bool IsEmpty => _values == null;
+ public bool IsEmpty
+ => _values == null;
}
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/SimplePrincipalKeyValueFactory.cs b/src/EFCore/ChangeTracking/Internal/SimplePrincipalKeyValueFactory.cs
index e11a5cfe567..f01edd4f1c6 100644
--- a/src/EFCore/ChangeTracking/Internal/SimplePrincipalKeyValueFactory.cs
+++ b/src/EFCore/ChangeTracking/Internal/SimplePrincipalKeyValueFactory.cs
@@ -120,8 +120,11 @@ private sealed class NoNullsStructuralEqualityComparer : IEqualityComparer
private readonly IEqualityComparer _comparer
= StructuralComparisons.StructuralEqualityComparer;
- public bool Equals(TKey x, TKey y) => _comparer.Equals(x, y);
- public int GetHashCode(TKey obj) => _comparer.GetHashCode(obj);
+ public bool Equals(TKey x, TKey y)
+ => _comparer.Equals(x, y);
+
+ public int GetHashCode(TKey obj)
+ => _comparer.GetHashCode(obj);
}
private sealed class NoNullsCustomEqualityComparer : IEqualityComparer
@@ -141,9 +144,11 @@ public NoNullsCustomEqualityComparer(ValueComparer comparer)
_hashCode = (Func)comparer.HashCodeExpression.Compile();
}
- public bool Equals(TKey x, TKey y) => _equals(x, y);
+ public bool Equals(TKey x, TKey y)
+ => _equals(x, y);
- public int GetHashCode(TKey obj) => _hashCode(obj);
+ public int GetHashCode(TKey obj)
+ => _hashCode(obj);
}
}
}
diff --git a/src/EFCore/ChangeTracking/Internal/SnapshotFactoryFactory.cs b/src/EFCore/ChangeTracking/Internal/SnapshotFactoryFactory.cs
index 51aef52a1e7..ceff009bb1f 100644
--- a/src/EFCore/ChangeTracking/Internal/SnapshotFactoryFactory.cs
+++ b/src/EFCore/ChangeTracking/Internal/SnapshotFactoryFactory.cs
@@ -218,7 +218,8 @@ private Expression CreateSnapshotValueExpression(Expression expression, IPropert
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
protected virtual Expression CreateReadShadowValueExpression(
- [CanBeNull] ParameterExpression parameter, [NotNull] IPropertyBase property)
+ [CanBeNull] ParameterExpression parameter,
+ [NotNull] IPropertyBase property)
=> Expression.Call(
parameter,
InternalEntityEntry.ReadShadowValueMethod.MakeGenericMethod(property.ClrType),
@@ -231,7 +232,8 @@ protected virtual Expression CreateReadShadowValueExpression(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
protected virtual Expression CreateReadValueExpression(
- [CanBeNull] ParameterExpression parameter, [NotNull] IPropertyBase property)
+ [CanBeNull] ParameterExpression parameter,
+ [NotNull] IPropertyBase property)
=> Expression.Call(
parameter,
InternalEntityEntry.GetCurrentValueMethod.MakeGenericMethod(property.ClrType),
@@ -259,7 +261,8 @@ protected virtual Expression CreateReadValueExpression(
/// 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.
///
- protected virtual bool UseEntityVariable => true;
+ protected virtual bool UseEntityVariable
+ => true;
private static readonly MethodInfo _snapshotCollectionMethod
= typeof(SnapshotFactoryFactory).GetTypeInfo().GetDeclaredMethod(nameof(SnapshotCollection));
diff --git a/src/EFCore/ChangeTracking/Internal/StateManager.cs b/src/EFCore/ChangeTracking/Internal/StateManager.cs
index 6f2d2ec4a1f..acdb22abb42 100644
--- a/src/EFCore/ChangeTracking/Internal/StateManager.cs
+++ b/src/EFCore/ChangeTracking/Internal/StateManager.cs
@@ -174,7 +174,8 @@ public virtual void StateChanging(InternalEntityEntry entry, EntityState newStat
/// 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.
///
- public virtual IModel Model => _model;
+ public virtual IModel Model
+ => _model;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -704,7 +705,9 @@ public virtual Task ResetStateAsync(CancellationToken cancellationToken = defaul
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual void RecordReferencedUntrackedEntity(
- object referencedEntity, INavigationBase navigation, InternalEntityEntry referencedFromEntry)
+ object referencedEntity,
+ INavigationBase navigation,
+ InternalEntityEntry referencedFromEntry)
{
if (_referencedUntrackedEntities == null)
{
@@ -764,7 +767,8 @@ public virtual InternalEntityEntry FindPrincipal(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual InternalEntityEntry FindPrincipalUsingPreStoreGeneratedValues(
- InternalEntityEntry dependentEntry, IForeignKey foreignKey)
+ InternalEntityEntry dependentEntry,
+ IForeignKey foreignKey)
=> FilterIncompatiblePrincipal(
foreignKey,
FindIdentityMap(foreignKey.PrincipalKey)
@@ -777,7 +781,8 @@ public virtual InternalEntityEntry FindPrincipalUsingPreStoreGeneratedValues(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual InternalEntityEntry FindPrincipalUsingRelationshipSnapshot(
- InternalEntityEntry dependentEntry, IForeignKey foreignKey)
+ InternalEntityEntry dependentEntry,
+ IForeignKey foreignKey)
=> FilterIncompatiblePrincipal(
foreignKey,
FindIdentityMap(foreignKey.PrincipalKey)
@@ -839,7 +844,8 @@ public virtual void UpdateDependentMap(InternalEntityEntry entry, IForeignKey fo
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual IEnumerable GetDependents(
- IUpdateEntry principalEntry, IForeignKey foreignKey)
+ IUpdateEntry principalEntry,
+ IForeignKey foreignKey)
{
var dependentIdentityMap = FindIdentityMap(foreignKey.DeclaringEntityType.FindPrimaryKey());
return dependentIdentityMap != null && foreignKey.PrincipalEntityType.IsAssignableFrom(principalEntry.EntityType)
@@ -854,7 +860,8 @@ public virtual IEnumerable GetDependents(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual IEnumerable GetDependentsUsingRelationshipSnapshot(
- IUpdateEntry principalEntry, IForeignKey foreignKey)
+ IUpdateEntry principalEntry,
+ IForeignKey foreignKey)
{
var dependentIdentityMap = FindIdentityMap(foreignKey.DeclaringEntityType.FindPrimaryKey());
return dependentIdentityMap != null
@@ -869,7 +876,8 @@ public virtual IEnumerable GetDependentsUsingRelationshipSnapshot(
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual IEnumerable GetDependentsFromNavigation(
- IUpdateEntry principalEntry, IForeignKey foreignKey)
+ IUpdateEntry principalEntry,
+ IForeignKey foreignKey)
{
var navigation = foreignKey.PrincipalToDependent;
if (navigation == null
@@ -1164,13 +1172,17 @@ private int SaveChanges(DbContext _, bool acceptAllChangesOnSuccess)
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
public virtual Task SaveChangesAsync(
- bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
+ bool acceptAllChangesOnSuccess,
+ CancellationToken cancellationToken = default)
=> Context.Database.AutoTransactionsEnabled
- ? Dependencies.ExecutionStrategyFactory.Create().ExecuteAsync(acceptAllChangesOnSuccess, SaveChangesAsync, null, cancellationToken)
+ ? Dependencies.ExecutionStrategyFactory.Create().ExecuteAsync(
+ acceptAllChangesOnSuccess, SaveChangesAsync, null, cancellationToken)
: SaveChangesAsync(Context, acceptAllChangesOnSuccess, cancellationToken);
private async Task SaveChangesAsync(
- DbContext _, bool acceptAllChangesOnSuccess, CancellationToken cancellationToken)
+ DbContext _,
+ bool acceptAllChangesOnSuccess,
+ CancellationToken cancellationToken)
{
if (ChangedCount == 0)
{
diff --git a/src/EFCore/ChangeTracking/Internal/StateManagerDependencies.cs b/src/EFCore/ChangeTracking/Internal/StateManagerDependencies.cs
index fd40b2dd0d7..fcc6cd6fd5b 100644
--- a/src/EFCore/ChangeTracking/Internal/StateManagerDependencies.cs
+++ b/src/EFCore/ChangeTracking/Internal/StateManagerDependencies.cs
@@ -474,7 +474,6 @@ public StateManagerDependencies With([NotNull] IEntityMaterializerSource entityM
UpdateLogger,
ChangeTrackingLogger);
-
///
/// Clones this dependency parameter object with one service replaced.
///
diff --git a/src/EFCore/ChangeTracking/LocalView.cs b/src/EFCore/ChangeTracking/LocalView.cs
index 99770c83834..04959f2af00 100644
--- a/src/EFCore/ChangeTracking/LocalView.cs
+++ b/src/EFCore/ChangeTracking/LocalView.cs
@@ -183,7 +183,8 @@ public virtual IEnumerator GetEnumerator()
/// that are not marked as deleted.
///
/// An enumerator for the collection.
- IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
+ IEnumerator IEnumerable.GetEnumerator()
+ => GetEnumerator();
///
///
@@ -248,11 +249,11 @@ public virtual void Clear()
}
///
- /// Returns if the entity is being tracked by the context and has not been
+ /// Returns if the entity is being tracked by the context and has not been
/// marked as Deleted.
///
/// The entity to check.
- /// if the entity is being tracked by the context and has not been marked as Deleted.
+ /// if the entity is being tracked by the context and has not been marked as Deleted.
public virtual bool Contains(TEntity item)
{
var entry = _context.GetDependencies().StateManager.TryGetEntry(item);
@@ -286,7 +287,7 @@ public virtual void CopyTo(TEntity[] array, int arrayIndex)
///
///
/// The entity to delete.
- /// if the entity was being tracked and was not already Deleted.
+ /// if the entity was being tracked and was not already Deleted.
public virtual bool Remove(TEntity item)
{
var entry = _context.GetDependencies().StateManager.TryGetEntry(item);
@@ -384,7 +385,8 @@ public virtual int Count
///
/// False, since the collection is not read-only.
///
- public virtual bool IsReadOnly => false;
+ public virtual bool IsReadOnly
+ => false;
///
/// Occurs when a property of this collection (such as ) changes.
@@ -424,9 +426,11 @@ protected virtual void OnPropertyChanging([NotNull] PropertyChangingEventArgs e)
protected virtual void OnCollectionChanged([NotNull] NotifyCollectionChangedEventArgs e)
=> CollectionChanged?.Invoke(this, e);
- private void OnCountPropertyChanged() => OnPropertyChanged(ObservableHashSetSingletons._countPropertyChanged);
+ private void OnCountPropertyChanged()
+ => OnPropertyChanged(ObservableHashSetSingletons._countPropertyChanged);
- private void OnCountPropertyChanging() => OnPropertyChanging(ObservableHashSetSingletons._countPropertyChanging);
+ private void OnCountPropertyChanging()
+ => OnPropertyChanging(ObservableHashSetSingletons._countPropertyChanging);
private void OnCollectionChanged(NotifyCollectionChangedAction action, object item)
=> OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item));
@@ -452,12 +456,14 @@ public virtual BindingList ToBindingList()
///
/// Always thrown.
/// Never returns, always throws an exception.
- IList IListSource.GetList() => throw new NotSupportedException(CoreStrings.DataBindingToLocalWithIListSource);
+ IList IListSource.GetList()
+ => throw new NotSupportedException(CoreStrings.DataBindingToLocalWithIListSource);
///
/// Gets a value indicating whether the collection is a collection of System.Collections.IList objects.
- /// Always returns .
+ /// Always returns .
///
- bool IListSource.ContainsListCollection => false;
+ bool IListSource.ContainsListCollection
+ => false;
}
}
diff --git a/src/EFCore/ChangeTracking/MemberEntry.cs b/src/EFCore/ChangeTracking/MemberEntry.cs
index 970c275aad6..4db26bffda0 100644
--- a/src/EFCore/ChangeTracking/MemberEntry.cs
+++ b/src/EFCore/ChangeTracking/MemberEntry.cs
@@ -87,7 +87,8 @@ public virtual object CurrentValue
/// The to which this member belongs.
///
/// An entry for the entity that owns this member.
- public virtual EntityEntry EntityEntry => new EntityEntry(InternalEntry);
+ public virtual EntityEntry EntityEntry
+ => new EntityEntry(InternalEntry);
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -96,7 +97,8 @@ public virtual object CurrentValue
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- InternalEntityEntry IInfrastructure.Instance => InternalEntry;
+ InternalEntityEntry IInfrastructure.Instance
+ => InternalEntry;
#region Hidden System.Object members
@@ -105,22 +107,25 @@ public virtual object CurrentValue
///
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/ChangeTracking/NavigationEntry.cs b/src/EFCore/ChangeTracking/NavigationEntry.cs
index 0613bdd77e7..0e33c71d88b 100644
--- a/src/EFCore/ChangeTracking/NavigationEntry.cs
+++ b/src/EFCore/ChangeTracking/NavigationEntry.cs
@@ -156,7 +156,7 @@ private static INavigationBase GetNavigation(InternalEntityEntry internalEntry,
///
///
///
- /// if all the related entities are loaded or the IsLoaded has been explicitly set to true.
+ /// if all the related entities are loaded or the IsLoaded has been explicitly set to true.
///
public virtual bool IsLoaded
{
diff --git a/src/EFCore/ChangeTracking/ObservableHashSet.cs b/src/EFCore/ChangeTracking/ObservableHashSet.cs
index d5fc62a2ae8..cec1a54cde2 100644
--- a/src/EFCore/ChangeTracking/ObservableHashSet.cs
+++ b/src/EFCore/ChangeTracking/ObservableHashSet.cs
@@ -88,7 +88,8 @@ public ObservableHashSet([NotNull] IEnumerable collection, [NotNull] IEqualit
///
public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
- void ICollection.Add(T item) => Add(item);
+ void ICollection.Add(T item)
+ => Add(item);
///
/// Removes all elements from the hash set.
@@ -117,9 +118,10 @@ public virtual void Clear()
///
/// The element to locate in the hash set.
///
- /// if the hash set contains the specified element; otherwise, .
+ /// if the hash set contains the specified element; otherwise, .
///
- public virtual bool Contains(T item) => _set.Contains(item);
+ public virtual bool Contains(T item)
+ => _set.Contains(item);
///
/// Copies the elements of the hash set to an array, starting at the specified array index.
@@ -129,14 +131,15 @@ public virtual void Clear()
/// the hash set. The array must have zero-based indexing.
///
/// The zero-based index in array at which copying begins.
- public virtual void CopyTo(T[] array, int arrayIndex) => _set.CopyTo(array, arrayIndex);
+ public virtual void CopyTo(T[] array, int arrayIndex)
+ => _set.CopyTo(array, arrayIndex);
///
/// Removes the specified element from the hash set.
///
/// The element to remove.
///
- /// if the element is successfully found and removed; otherwise, .
+ /// if the element is successfully found and removed; otherwise, .
///
public virtual bool Remove(T item)
{
@@ -159,12 +162,14 @@ public virtual bool Remove(T item)
///
/// Gets the number of elements that are contained in the hash set.
///
- public virtual int Count => _set.Count;
+ public virtual int Count
+ => _set.Count;
///
/// Gets a value indicating whether the hash set is read-only.
///
- public virtual bool IsReadOnly => ((ICollection)_set).IsReadOnly;
+ public virtual bool IsReadOnly
+ => ((ICollection)_set).IsReadOnly;
///
/// Returns an enumerator that iterates through the hash set.
@@ -172,20 +177,23 @@ public virtual bool Remove(T item)
///
/// An enumerator for the hash set.
///
- public virtual HashSet.Enumerator GetEnumerator() => _set.GetEnumerator();
+ public virtual HashSet.Enumerator GetEnumerator()
+ => _set.GetEnumerator();
///
- IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
+ IEnumerator IEnumerable.GetEnumerator()
+ => GetEnumerator();
///
- IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
+ IEnumerator IEnumerable.GetEnumerator()
+ => GetEnumerator();
///
/// Adds the specified element to the hash set.
///
/// The element to add to the set.
///
- /// if the element is added to the hash set; if the element is already present.
+ /// if the element is added to the hash set; if the element is already present.
///
public virtual bool Add(T item)
{
@@ -318,54 +326,60 @@ public virtual void SymmetricExceptWith(IEnumerable other)
///
/// The collection to compare to the current hash set.
///
- /// if the hash set is a subset of other; otherwise, .
+ /// if the hash set is a subset of other; otherwise, .
///
- public virtual bool IsSubsetOf(IEnumerable other) => _set.IsSubsetOf(other);
+ public virtual bool IsSubsetOf(IEnumerable other)
+ => _set.IsSubsetOf(other);
///
/// Determines whether the hash set is a proper subset of the specified collection.
///
/// The collection to compare to the current hash set.
///
- /// if the hash set is a proper subset of other; otherwise, .
+ /// if the hash set is a proper subset of other; otherwise, .
///
- public virtual bool IsProperSubsetOf(IEnumerable other) => _set.IsProperSubsetOf(other);
+ public virtual bool IsProperSubsetOf(IEnumerable other)
+ => _set.IsProperSubsetOf(other);
///
/// Determines whether the hash set is a superset of the specified collection.
///
/// The collection to compare to the current hash set.
///
- /// if the hash set is a superset of other; otherwise, .
+ /// if the hash set is a superset of other; otherwise, .
///
- public virtual bool IsSupersetOf(IEnumerable other) => _set.IsSupersetOf(other);
+ public virtual bool IsSupersetOf(IEnumerable other)
+ => _set.IsSupersetOf(other);
///
/// Determines whether the hash set is a proper superset of the specified collection.
///
/// The collection to compare to the current hash set.
///
- /// if the hash set is a proper superset of other; otherwise, .
+ /// if the hash set is a proper superset of other; otherwise, .
///
- public virtual bool IsProperSupersetOf(IEnumerable other) => _set.IsProperSupersetOf(other);
+ public virtual bool IsProperSupersetOf(IEnumerable other)
+ => _set.IsProperSupersetOf(other);
///
/// Determines whether the current System.Collections.Generic.HashSet`1 object and a specified collection share common elements.
///
/// The collection to compare to the current hash set.
///
- /// if the hash set and other share at least one common element; otherwise, .
+ /// if the hash set and other share at least one common element; otherwise, .
///
- public virtual bool Overlaps(IEnumerable other) => _set.Overlaps(other);
+ public virtual bool Overlaps(IEnumerable other)
+ => _set.Overlaps(other);
///
/// Determines whether the hash set and the specified collection contain the same elements.
///
/// The collection to compare to the current hash set.
///
- /// if the hash set is equal to other; otherwise, .
+ /// if the hash set is equal to other; otherwise, .
///
- public virtual bool SetEquals(IEnumerable other) => _set.SetEquals(other);
+ public virtual bool SetEquals(IEnumerable other)
+ => _set.SetEquals(other);
///
/// Copies the elements of the hash set to an array.
@@ -374,7 +388,8 @@ public virtual void SymmetricExceptWith(IEnumerable other)
/// The one-dimensional array that is the destination of the elements copied from
/// the hash set. The array must have zero-based indexing.
///
- public virtual void CopyTo([NotNull] T[] array) => _set.CopyTo(array);
+ public virtual void CopyTo([NotNull] T[] array)
+ => _set.CopyTo(array);
///
/// Copies the specified number of elements of the hash set to an array, starting at the specified array index.
@@ -385,7 +400,8 @@ public virtual void SymmetricExceptWith(IEnumerable other)
///
/// The zero-based index in array at which copying begins.
/// The number of elements to copy to array.
- public virtual void CopyTo([NotNull] T[] array, int arrayIndex, int count) => _set.CopyTo(array, arrayIndex, count);
+ public virtual void CopyTo([NotNull] T[] array, int arrayIndex, int count)
+ => _set.CopyTo(array, arrayIndex, count);
///
/// Removes all elements that match the conditions defined by the specified predicate
@@ -422,13 +438,15 @@ public virtual int RemoveWhere([NotNull] Predicate match)
///
/// Gets the object that is used to determine equality for the values in the set.
///
- public virtual IEqualityComparer Comparer => _set.Comparer;
+ public virtual IEqualityComparer Comparer
+ => _set.Comparer;
///
/// Sets the capacity of the hash set to the actual number of elements it contains, rounded up to a nearby,
/// implementation-specific value.
///
- public virtual void TrimExcess() => _set.TrimExcess();
+ public virtual void TrimExcess()
+ => _set.TrimExcess();
///
/// Raises the event.
@@ -444,9 +462,11 @@ protected virtual void OnPropertyChanged([NotNull] PropertyChangedEventArgs e)
protected virtual void OnPropertyChanging([NotNull] PropertyChangingEventArgs e)
=> PropertyChanging?.Invoke(this, e);
- private void OnCountPropertyChanged() => OnPropertyChanged(ObservableHashSetSingletons._countPropertyChanged);
+ private void OnCountPropertyChanged()
+ => OnPropertyChanged(ObservableHashSetSingletons._countPropertyChanged);
- private void OnCountPropertyChanging() => OnPropertyChanging(ObservableHashSetSingletons._countPropertyChanging);
+ private void OnCountPropertyChanging()
+ => OnPropertyChanging(ObservableHashSetSingletons._countPropertyChanging);
private void OnCollectionChanged(NotifyCollectionChangedAction action, object item)
=> OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item));
diff --git a/src/EFCore/ChangeTracking/PropertyEntry.cs b/src/EFCore/ChangeTracking/PropertyEntry.cs
index 0314cbef19b..4c0c58ffe68 100644
--- a/src/EFCore/ChangeTracking/PropertyEntry.cs
+++ b/src/EFCore/ChangeTracking/PropertyEntry.cs
@@ -5,7 +5,6 @@
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Metadata.Internal;
namespace Microsoft.EntityFrameworkCore.ChangeTracking
{
diff --git a/src/EFCore/ChangeTracking/PropertyEntry`.cs b/src/EFCore/ChangeTracking/PropertyEntry`.cs
index fc2ef3b404f..c9d1823b613 100644
--- a/src/EFCore/ChangeTracking/PropertyEntry`.cs
+++ b/src/EFCore/ChangeTracking/PropertyEntry`.cs
@@ -50,7 +50,8 @@ public PropertyEntry([NotNull] InternalEntityEntry internalEntry, [NotNull] IPro
/// The to which this member belongs.
///
/// An entry for the entity that owns this member.
- public new virtual EntityEntry EntityEntry => new EntityEntry(InternalEntry);
+ public new virtual EntityEntry EntityEntry
+ => new EntityEntry(InternalEntry);
///
/// Gets or sets the value currently assigned to this property. If the current value is set using this property,
diff --git a/src/EFCore/ChangeTracking/PropertyValues.cs b/src/EFCore/ChangeTracking/PropertyValues.cs
index bdf6cd63b7f..23df1246e57 100644
--- a/src/EFCore/ChangeTracking/PropertyValues.cs
+++ b/src/EFCore/ChangeTracking/PropertyValues.cs
@@ -4,8 +4,8 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
-using JetBrains.Annotations;
using System.Linq;
+using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
@@ -160,14 +160,14 @@ public virtual IEntityType EntityType
/// True if the property exists, otherwise false.
public virtual bool TryGetValue([NotNull] string propertyName, out TValue value)
{
- var property = Properties.FirstOrDefault(p=> p.Name == propertyName);
+ var property = Properties.FirstOrDefault(p => p.Name == propertyName);
if (property != null)
{
value = GetValue(propertyName);
return true;
}
- value = default(TValue);
+ value = default;
return false;
}
@@ -187,22 +187,25 @@ public virtual bool TryGetValue([NotNull] string propertyName, out TValu
///
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/ChangeTracking/ReferenceEntry.cs b/src/EFCore/ChangeTracking/ReferenceEntry.cs
index 6c5f59a9b3a..93cc1cb5010 100644
--- a/src/EFCore/ChangeTracking/ReferenceEntry.cs
+++ b/src/EFCore/ChangeTracking/ReferenceEntry.cs
@@ -171,7 +171,7 @@ public override bool IsModified
}
}
- private void SetFkPropertiesModified(
+ private void SetFkPropertiesModified(
INavigation navigation,
InternalEntityEntry internalEntityEntry,
bool modified)
diff --git a/src/EFCore/ChangeTracking/ReferenceEntry`.cs b/src/EFCore/ChangeTracking/ReferenceEntry`.cs
index 955df0d0ea9..a612aba30e8 100644
--- a/src/EFCore/ChangeTracking/ReferenceEntry`.cs
+++ b/src/EFCore/ChangeTracking/ReferenceEntry`.cs
@@ -53,7 +53,8 @@ public ReferenceEntry([NotNull] InternalEntityEntry internalEntry, [NotNull] INa
/// The to which this member belongs.
///
/// An entry for the entity that owns this member.
- public new virtual EntityEntry EntityEntry => new EntityEntry(InternalEntry);
+ public new virtual EntityEntry EntityEntry
+ => new EntityEntry(InternalEntry);
///
/// The of the entity this navigation targets.
diff --git a/src/EFCore/ChangeTracking/ValueComparer.cs b/src/EFCore/ChangeTracking/ValueComparer.cs
index 9adfa50a968..2f4cb6665ae 100644
--- a/src/EFCore/ChangeTracking/ValueComparer.cs
+++ b/src/EFCore/ChangeTracking/ValueComparer.cs
@@ -30,11 +30,12 @@ public abstract class ValueComparer : IEqualityComparer
{
internal static readonly MethodInfo ArrayCopyMethod
= typeof(Array).GetMethods()
- .Single(t => t.Name == nameof(Array.Copy)
- && t.GetParameters().Length == 3
- && t.GetParameters()[0].ParameterType == typeof(Array)
- && t.GetParameters()[1].ParameterType == typeof(Array)
- && t.GetParameters()[2].ParameterType == typeof(int));
+ .Single(
+ t => t.Name == nameof(Array.Copy)
+ && t.GetParameters().Length == 3
+ && t.GetParameters()[0].ParameterType == typeof(Array)
+ && t.GetParameters()[1].ParameterType == typeof(Array)
+ && t.GetParameters()[2].ParameterType == typeof(int));
internal static readonly MethodInfo EqualityComparerHashCodeMethod
= typeof(IEqualityComparer).GetRuntimeMethod(nameof(IEqualityComparer.GetHashCode), new[] { typeof(object) });
diff --git a/src/EFCore/ChangeTracking/ValueComparerExtensions.cs b/src/EFCore/ChangeTracking/ValueComparerExtensions.cs
index 393db07e24a..3d96ad50c22 100644
--- a/src/EFCore/ChangeTracking/ValueComparerExtensions.cs
+++ b/src/EFCore/ChangeTracking/ValueComparerExtensions.cs
@@ -11,10 +11,10 @@ namespace Microsoft.EntityFrameworkCore.ChangeTracking
public static class ValueComparerExtensions
{
///
- /// Returns if the given is a default EF Core implementation.
+ /// Returns if the given is a default EF Core implementation.
///
/// The value comparer.
- /// if the value comparer is the default; otherwise.
+ /// if the value comparer is the default; otherwise.
public static bool IsDefault([NotNull] this ValueComparer valueComparer)
=> valueComparer.GetType().IsGenericType
&& valueComparer.GetType().GetGenericTypeDefinition() == typeof(ValueComparer.DefaultValueComparer<>);
diff --git a/src/EFCore/ChangeTracking/ValueComparer`.cs b/src/EFCore/ChangeTracking/ValueComparer`.cs
index f9155d1f034..a7a95b58843 100644
--- a/src/EFCore/ChangeTracking/ValueComparer`.cs
+++ b/src/EFCore/ChangeTracking/ValueComparer`.cs
@@ -315,7 +315,8 @@ public virtual T Snapshot([CanBeNull] T instance)
///
/// The type.
///
- public override Type Type => typeof(T);
+ public override Type Type
+ => typeof(T);
///
/// The comparison expression.
diff --git a/src/EFCore/DbContext.cs b/src/EFCore/DbContext.cs
index ac593d65f93..d63a38ec922 100644
--- a/src/EFCore/DbContext.cs
+++ b/src/EFCore/DbContext.cs
@@ -160,7 +160,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IDbSetSource IDbContextDependencies.SetSource => DbContextDependencies.SetSource;
+ IDbSetSource IDbContextDependencies.SetSource
+ => DbContextDependencies.SetSource;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -169,7 +170,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IEntityFinderFactory IDbContextDependencies.EntityFinderFactory => DbContextDependencies.EntityFinderFactory;
+ IEntityFinderFactory IDbContextDependencies.EntityFinderFactory
+ => DbContextDependencies.EntityFinderFactory;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -178,7 +180,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IAsyncQueryProvider IDbContextDependencies.QueryProvider => DbContextDependencies.QueryProvider;
+ IAsyncQueryProvider IDbContextDependencies.QueryProvider
+ => DbContextDependencies.QueryProvider;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -187,7 +190,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IStateManager IDbContextDependencies.StateManager => DbContextDependencies.StateManager;
+ IStateManager IDbContextDependencies.StateManager
+ => DbContextDependencies.StateManager;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -196,7 +200,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IChangeDetector IDbContextDependencies.ChangeDetector => DbContextDependencies.ChangeDetector;
+ IChangeDetector IDbContextDependencies.ChangeDetector
+ => DbContextDependencies.ChangeDetector;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -205,7 +210,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IEntityGraphAttacher IDbContextDependencies.EntityGraphAttacher => DbContextDependencies.EntityGraphAttacher;
+ IEntityGraphAttacher IDbContextDependencies.EntityGraphAttacher
+ => DbContextDependencies.EntityGraphAttacher;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -214,7 +220,8 @@ public virtual DbContextId ContextId
/// doing so can result in application failures when updating to a new Entity Framework Core release.
///
[EntityFrameworkInternal]
- IDiagnosticsLogger IDbContextDependencies.UpdateLogger => DbContextDependencies.UpdateLogger;
+ IDiagnosticsLogger IDbContextDependencies.UpdateLogger
+ => DbContextDependencies.UpdateLogger;
///
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -457,7 +464,8 @@ protected internal virtual void OnModelCreating(ModelBuilder modelBuilder)
/// A concurrency violation occurs when an unexpected number of rows are affected during save.
/// This is usually because the data in the database has been modified since it was loaded into memory.
///
- public virtual int SaveChanges() => SaveChanges(acceptAllChangesOnSuccess: true);
+ public virtual int SaveChanges()
+ => SaveChanges(acceptAllChangesOnSuccess: true);
///
///
@@ -652,17 +660,17 @@ await DbContextDependencies.UpdateLogger.OptimisticConcurrencyExceptionAsync(thi
}
///
- /// An event fired at the beginning of a call to or
+ /// An event fired at the beginning of a call to or
///
public event EventHandler SavingChanges;
///
- /// An event fired at the end of a call to or
+ /// An event fired at the end of a call to or
///
public event EventHandler SavedChanges;
///
- /// An event fired if a call to or fails with an exception.
+ /// An event fired if a call to or fails with an exception.
///
public event EventHandler SaveChangesFailed;
@@ -691,10 +699,13 @@ void IDbContextPoolable.SetLease(DbContextLease lease)
if (_configurationSnapshot?.AutoDetectChangesEnabled != null)
{
- Check.DebugAssert(_configurationSnapshot.QueryTrackingBehavior.HasValue, "!configurationSnapshot.QueryTrackingBehavior.HasValue");
+ Check.DebugAssert(
+ _configurationSnapshot.QueryTrackingBehavior.HasValue, "!configurationSnapshot.QueryTrackingBehavior.HasValue");
Check.DebugAssert(_configurationSnapshot.LazyLoadingEnabled.HasValue, "!configurationSnapshot.LazyLoadingEnabled.HasValue");
- Check.DebugAssert(_configurationSnapshot.CascadeDeleteTiming.HasValue, "!configurationSnapshot.CascadeDeleteTiming.HasValue");
- Check.DebugAssert(_configurationSnapshot.DeleteOrphansTiming.HasValue, "!configurationSnapshot.DeleteOrphansTiming.HasValue");
+ Check.DebugAssert(
+ _configurationSnapshot.CascadeDeleteTiming.HasValue, "!configurationSnapshot.CascadeDeleteTiming.HasValue");
+ Check.DebugAssert(
+ _configurationSnapshot.DeleteOrphansTiming.HasValue, "!configurationSnapshot.DeleteOrphansTiming.HasValue");
ChangeTracker.AutoDetectChangesEnabled = _configurationSnapshot.AutoDetectChangesEnabled.Value;
ChangeTracker.QueryTrackingBehavior = _configurationSnapshot.QueryTrackingBehavior.Value;
@@ -1518,9 +1529,9 @@ public virtual async Task AddRangeAsync(
foreach (var entity in entities)
{
await SetEntityStateAsync(
- stateManager.GetOrCreateEntry(entity),
- EntityState.Added,
- cancellationToken)
+ stateManager.GetOrCreateEntry(entity),
+ EntityState.Added,
+ cancellationToken)
.ConfigureAwait(false);
}
}
@@ -1688,7 +1699,9 @@ public virtual ValueTask FindAsync([NotNull] Type entityType, [CanBeNull
/// A to observe while waiting for the task to complete.
/// The entity found, or null.
public virtual ValueTask FindAsync(
- [NotNull] Type entityType, [CanBeNull] object[] keyValues, CancellationToken cancellationToken)
+ [NotNull] Type entityType,
+ [CanBeNull] object[] keyValues,
+ CancellationToken cancellationToken)
{
CheckDisposed();
@@ -1759,14 +1772,15 @@ public virtual ValueTask FindAsync([CanBeNull] object[] keyVal
/// not directly exposed in the public API surface.
///
///
- IServiceProvider IInfrastructure.Instance => InternalServiceProvider;
+ IServiceProvider IInfrastructure.Instance
+ => InternalServiceProvider;
///
/// Creates a queryable for given query expression.
///
/// The result type of the query expression.
/// The query expression to create.
- /// An representing the query.
+ /// An representing the query.
public virtual IQueryable FromExpression([NotNull] Expression>> expression)
{
Check.NotNull(expression, nameof(expression));
@@ -1781,22 +1795,25 @@ public virtual IQueryable FromExpression([NotNull] Expression<
///
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/DbContextId.cs b/src/EFCore/DbContextId.cs
index f7d8abd2c9d..9f4b946d9d7 100644
--- a/src/EFCore/DbContextId.cs
+++ b/src/EFCore/DbContextId.cs
@@ -21,7 +21,7 @@ public readonly struct DbContextId
/// Compares this ID to another ID to see if they represent the same leased context.
///
/// The other ID.
- /// if they represent the same leased context; otherwise.
+ /// if they represent the same leased context; otherwise.
public bool Equals(DbContextId other)
=> InstanceId == other.InstanceId
&& Lease == other.Lease;
@@ -30,7 +30,7 @@ public bool Equals(DbContextId other)
/// Compares this ID to another ID to see if they represent the same leased context.
///
/// The other ID.
- /// if they represent the same leased context; otherwise.
+ /// if they represent the same leased context; otherwise.
public override bool Equals(object obj)
=> obj is DbContextId other && Equals(other);
@@ -46,16 +46,18 @@ public override int GetHashCode()
///
/// The first ID.
/// The second ID.
- /// if they represent the same leased context; otherwise.
- public static bool operator ==(DbContextId left, DbContextId right) => left.Equals(right);
+ /// if they represent the same leased context; otherwise.
+ public static bool operator ==(DbContextId left, DbContextId right)
+ => left.Equals(right);
///
/// Compares one ID to another ID to see if they represent different leased contexts.
///
/// The first ID.
/// The second ID.
- /// if they represent different leased contexts; otherwise.
- public static bool operator !=(DbContextId left, DbContextId right) => !left.Equals(right);
+ /// if they represent different leased contexts; otherwise.
+ public static bool operator !=(DbContextId left, DbContextId right)
+ => !left.Equals(right);
///
/// Creates a new with the given and lease number.
diff --git a/src/EFCore/DbContextOptions.cs b/src/EFCore/DbContextOptions.cs
index 5271f39c4ff..d421ee6eafa 100644
--- a/src/EFCore/DbContextOptions.cs
+++ b/src/EFCore/DbContextOptions.cs
@@ -34,7 +34,8 @@ protected DbContextOptions(
///
/// Gets the extensions that store the configured options.
///
- public virtual IEnumerable Extensions => _extensions.Values;
+ public virtual IEnumerable Extensions
+ => _extensions.Values;
///
/// Gets the extension of the specified type. Returns null if no extension of the specified type is configured.
@@ -83,10 +84,11 @@ public abstract DbContextOptions WithExtension([NotNull] TExtension
///
/// Specifies that no further configuration of this options object should occur.
///
- public virtual void Freeze() => IsFrozen = true;
+ public virtual void Freeze()
+ => IsFrozen = true;
///
- /// Returns if has been called. A frozen options object cannot be further
+ /// Returns if has been called. A frozen options object cannot be further
/// configured with .
///
public virtual bool IsFrozen { get; private set; }
diff --git a/src/EFCore/DbContextOptionsBuilder.cs b/src/EFCore/DbContextOptionsBuilder.cs
index 3b367ba212a..096d423cd0f 100644
--- a/src/EFCore/DbContextOptionsBuilder.cs
+++ b/src/EFCore/DbContextOptionsBuilder.cs
@@ -57,7 +57,8 @@ public DbContextOptionsBuilder([NotNull] DbContextOptions options)
///
/// Gets the options being configured.
///
- public virtual DbContextOptions Options => _options;
+ public virtual DbContextOptions Options
+ => _options;
///
///
@@ -70,7 +71,8 @@ public DbContextOptionsBuilder([NotNull] DbContextOptions options)
/// .
///
///
- public virtual bool IsConfigured => _options.Extensions.Any(e => e.Info.IsDatabaseProvider);
+ public virtual bool IsConfigured
+ => _options.Extensions.Any(e => e.Info.IsDatabaseProvider);
///
///
@@ -113,7 +115,9 @@ public virtual DbContextOptionsBuilder UseLoggerFactory([CanBeNull] ILoggerFacto
///
///
/// This overload allows the minimum level of logging and the log formatting to be controlled.
- /// Use the
+ /// Use the
+ ///
/// overload to log only specific events.
/// Use the
/// overload to log only events in specific categories.
@@ -637,22 +641,25 @@ private DbContextOptionsBuilder WithOption(Func
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/DbContextOptionsBuilder`.cs b/src/EFCore/DbContextOptionsBuilder`.cs
index 6c78663630b..f58155e525a 100644
--- a/src/EFCore/DbContextOptionsBuilder`.cs
+++ b/src/EFCore/DbContextOptionsBuilder`.cs
@@ -51,7 +51,8 @@ public DbContextOptionsBuilder([NotNull] DbContextOptions options)
///
/// Gets the options being configured.
///
- public new virtual DbContextOptions Options => (DbContextOptions)base.Options;
+ public new virtual DbContextOptions Options
+ => (DbContextOptions)base.Options;
///
/// Sets the model to be used for the context. If the model is set, then
@@ -90,7 +91,9 @@ public DbContextOptionsBuilder([NotNull] DbContextOptions options)
///
///
/// This overload allows the minimum level of logging and the log formatting to be controlled.
- /// Use the
+ /// Use the
+ ///
/// overload to log only specific events.
/// Use the
/// overload to log only events in specific categories.
diff --git a/src/EFCore/DbContextOptions`.cs b/src/EFCore/DbContextOptions`.cs
index 4509c7b0611..3f9b0937577 100644
--- a/src/EFCore/DbContextOptions`.cs
+++ b/src/EFCore/DbContextOptions`.cs
@@ -61,6 +61,7 @@ public override DbContextOptions WithExtension(TExtension extension)
///
/// The type of context that these options are for ().
///
- public override Type ContextType => typeof(TContext);
+ public override Type ContextType
+ => typeof(TContext);
}
}
diff --git a/src/EFCore/DbFunctions.cs b/src/EFCore/DbFunctions.cs
index c3bfafe48c3..f26ee36afd2 100644
--- a/src/EFCore/DbFunctions.cs
+++ b/src/EFCore/DbFunctions.cs
@@ -24,22 +24,25 @@ private DbFunctions()
///
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/DbFunctionsExtensions.cs b/src/EFCore/DbFunctionsExtensions.cs
index f423fa0f14b..c1ed88c73a4 100644
--- a/src/EFCore/DbFunctionsExtensions.cs
+++ b/src/EFCore/DbFunctionsExtensions.cs
@@ -29,7 +29,7 @@ public static class DbFunctionsExtensions
/// The DbFunctions instance.
/// The string that is to be matched.
/// The pattern which may involve wildcards %,_,[,],^.
- /// if there is a match.
+ /// if there is a match.
public static bool Like(
[CanBeNull] this DbFunctions _,
[CanBeNull] string matchExpression,
@@ -55,7 +55,7 @@ public static bool Like(
/// The escape character (as a single character string) to use in front of %,_,[,],^
/// if they are not used as wildcards.
///
- /// if there is a match.
+ /// if there is a match.
public static bool Like(
[CanBeNull] this DbFunctions _,
[CanBeNull] string matchExpression,
diff --git a/src/EFCore/DbSet.cs b/src/EFCore/DbSet.cs
index 79d0bd66cf2..871c445e23e 100644
--- a/src/EFCore/DbSet.cs
+++ b/src/EFCore/DbSet.cs
@@ -44,9 +44,10 @@ public abstract class DbSet
where TEntity : class
{
///
- /// The metadata associated with this set.
+ /// The metadata associated with this set.
///
- public virtual IEntityType EntityType => null;
+ public virtual IEntityType EntityType
+ => null;
///
///
@@ -58,7 +59,8 @@ public abstract class DbSet
///
///
/// This object.
- public virtual IAsyncEnumerable AsAsyncEnumerable() => this;
+ public virtual IAsyncEnumerable AsAsyncEnumerable()
+ => this;
///
///
@@ -70,7 +72,8 @@ public abstract class DbSet
///
///
/// This object.
- public virtual IQueryable AsQueryable() => this;
+ public virtual IQueryable AsQueryable()
+ => this;
///
///
@@ -90,7 +93,8 @@ public abstract class DbSet
/// for WinForms.
///
///
- public virtual LocalView Local => throw new NotImplementedException();
+ public virtual LocalView Local
+ => throw new NotImplementedException();
///
/// Finds an entity with the given primary key values. If an entity with the given primary key values
@@ -101,7 +105,8 @@ public abstract class DbSet
///
/// The values of the primary key for the entity to be found.
/// The entity found, or null.
- public virtual TEntity Find([CanBeNull] params object[] keyValues) => throw new NotImplementedException();
+ public virtual TEntity Find([CanBeNull] params object[] keyValues)
+ => throw new NotImplementedException();
///
/// Finds an entity with the given primary key values. If an entity with the given primary key values
@@ -112,7 +117,8 @@ public abstract class DbSet
///
/// The values of the primary key for the entity to be found.
/// The entity found, or null.
- public virtual ValueTask FindAsync([CanBeNull] params object[] keyValues) => throw new NotImplementedException();
+ public virtual ValueTask FindAsync([CanBeNull] params object[] keyValues)
+ => throw new NotImplementedException();
///
/// Finds an entity with the given primary key values. If an entity with the given primary key values
@@ -142,7 +148,8 @@ public virtual ValueTask FindAsync([CanBeNull] object[] keyValues, Canc
/// The for the entity. The entry provides
/// access to change tracking information and operations for the entity.
///
- public virtual EntityEntry Add([NotNull] TEntity entity) => throw new NotImplementedException();
+ public virtual EntityEntry Add([NotNull] TEntity entity)
+ => throw new NotImplementedException();
///
///
@@ -168,7 +175,8 @@ public virtual ValueTask FindAsync([CanBeNull] object[] keyValues, Canc
///
public virtual ValueTask> AddAsync(
[NotNull] TEntity entity,
- CancellationToken cancellationToken = default) => throw new NotImplementedException();
+ CancellationToken cancellationToken = default)
+ => throw new NotImplementedException();
///
///
@@ -204,7 +212,8 @@ public virtual ValueTask> AddAsync(
/// The for the entity. The entry provides
/// access to change tracking information and operations for the entity.
///
- public virtual EntityEntry Attach([NotNull] TEntity entity) => throw new NotImplementedException();
+ public virtual EntityEntry Attach([NotNull] TEntity entity)
+ => throw new NotImplementedException();
///
/// Begins tracking the given entity in the state such that it will
@@ -230,7 +239,8 @@ public virtual ValueTask> AddAsync(
/// The for the entity. The entry provides
/// access to change tracking information and operations for the entity.
///
- public virtual EntityEntry Remove([NotNull] TEntity entity) => throw new NotImplementedException();
+ public virtual EntityEntry Remove([NotNull] TEntity entity)
+ => throw new NotImplementedException();
///
///
@@ -266,7 +276,8 @@ public virtual ValueTask> AddAsync(
/// The for the entity. The entry provides
/// access to change tracking information and operations for the entity.
///
- public virtual EntityEntry Update([NotNull] TEntity entity) => throw new NotImplementedException();
+ public virtual EntityEntry Update([NotNull] TEntity entity)
+ => throw new NotImplementedException();
///
/// Begins tracking the given entities, and any other reachable entities that are
@@ -274,7 +285,8 @@ public virtual ValueTask> AddAsync(
/// be inserted into the database when is called.
///
/// The entities to add.
- public virtual void AddRange([NotNull] params TEntity[] entities) => throw new NotImplementedException();
+ public virtual void AddRange([NotNull] params TEntity[] entities)
+ => throw new NotImplementedException();
///
///
@@ -290,7 +302,8 @@ public virtual ValueTask> AddAsync(
///
/// The entities to add.
/// A task that represents the asynchronous operation.
- public virtual Task AddRangeAsync([NotNull] params TEntity[] entities) => throw new NotImplementedException();
+ public virtual Task AddRangeAsync([NotNull] params TEntity[] entities)
+ => throw new NotImplementedException();
///
///
@@ -322,7 +335,8 @@ public virtual ValueTask> AddAsync(
///
///
/// The entities to attach.
- public virtual void AttachRange([NotNull] params TEntity[] entities) => throw new NotImplementedException();
+ public virtual void AttachRange([NotNull] params TEntity[] entities)
+ => throw new NotImplementedException();
///
/// Begins tracking the given entities in the state such that they will
@@ -341,7 +355,8 @@ public virtual ValueTask> AddAsync(
///
///
/// The entities to remove.
- public virtual void RemoveRange([NotNull] params TEntity[] entities) => throw new NotImplementedException();
+ public virtual void RemoveRange([NotNull] params TEntity[] entities)
+ => throw new NotImplementedException();
///
///
@@ -373,7 +388,8 @@ public virtual ValueTask> AddAsync(
///
///
/// The entities to update.
- public virtual void UpdateRange([NotNull] params TEntity[] entities) => throw new NotImplementedException();
+ public virtual void UpdateRange([NotNull] params TEntity[] entities)
+ => throw new NotImplementedException();
///
/// Begins tracking the given entities, and any other reachable entities that are
@@ -381,7 +397,8 @@ public virtual ValueTask> AddAsync(
/// be inserted into the database when is called.
///
/// The entities to add.
- public virtual void AddRange([NotNull] IEnumerable entities) => throw new NotImplementedException();
+ public virtual void AddRange([NotNull] IEnumerable entities)
+ => throw new NotImplementedException();
///
///
@@ -400,7 +417,8 @@ public virtual ValueTask> AddAsync(
/// A task that represents the asynchronous operation.
public virtual Task AddRangeAsync(
[NotNull] IEnumerable entities,
- CancellationToken cancellationToken = default) => throw new NotImplementedException();
+ CancellationToken cancellationToken = default)
+ => throw new NotImplementedException();
///
///
@@ -432,7 +450,8 @@ public virtual Task AddRangeAsync(
///
///
/// The entities to attach.
- public virtual void AttachRange([NotNull] IEnumerable entities) => throw new NotImplementedException();
+ public virtual void AttachRange([NotNull] IEnumerable entities)
+ => throw new NotImplementedException();
///
/// Begins tracking the given entities in the state such that they will
@@ -451,7 +470,8 @@ public virtual Task AddRangeAsync(
///
///
/// The entities to remove.
- public virtual void RemoveRange([NotNull] IEnumerable entities) => throw new NotImplementedException();
+ public virtual void RemoveRange([NotNull] IEnumerable entities)
+ => throw new NotImplementedException();
///
///
@@ -483,21 +503,24 @@ public virtual Task AddRangeAsync(
///
///
/// The entities to update.
- public virtual void UpdateRange([NotNull] IEnumerable entities) => throw new NotImplementedException();
+ public virtual void UpdateRange([NotNull] IEnumerable entities)
+ => throw new NotImplementedException();
///
/// Returns an which when enumerated will execute a query against the database
/// to load all entities from the database.
///
/// The query results.
- IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();
+ IEnumerator IEnumerable.GetEnumerator()
+ => throw new NotImplementedException();
///
/// Returns an which when enumerated will execute a query against the database
/// to load all entities from the database.
///
/// The query results.
- IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();
+ IEnumerator IEnumerable.GetEnumerator()
+ => throw new NotImplementedException();
///
/// Returns an which when enumerated will asynchronously execute a query against
@@ -510,17 +533,20 @@ IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(Cancellat
///
/// Gets the IQueryable element type.
///
- Type IQueryable.ElementType => throw new NotImplementedException();
+ Type IQueryable.ElementType
+ => throw new NotImplementedException();
///
/// Gets the IQueryable LINQ Expression.
///
- Expression IQueryable.Expression => throw new NotImplementedException();
+ Expression IQueryable.Expression
+ => throw new NotImplementedException();
///
/// Gets the IQueryable provider.
///
- IQueryProvider IQueryable.Provider => throw new NotImplementedException();
+ IQueryProvider IQueryable.Provider
+ => throw new NotImplementedException();
///
///
@@ -531,7 +557,8 @@ IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(Cancellat
/// not directly exposed in the public API surface.
///
///
- IServiceProvider IInfrastructure.Instance => throw new NotImplementedException();
+ IServiceProvider IInfrastructure.Instance
+ => throw new NotImplementedException();
///
///
@@ -558,9 +585,10 @@ IList IListSource.GetList()
///
/// Gets a value indicating whether the collection is a collection of System.Collections.IList objects.
- /// Always returns .
+ /// Always returns .
///
- bool IListSource.ContainsListCollection => false;
+ bool IListSource.ContainsListCollection
+ => false;
#region Hidden System.Object members
@@ -569,22 +597,25 @@ IList IListSource.GetList()
///
/// A string that represents the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override string ToString() => base.ToString();
+ public override string ToString()
+ => base.ToString();
///
/// Determines whether the specified object is equal to the current object.
///
/// The object to compare with the current object.
- /// if the specified object is equal to the current object; otherwise, .
+ /// if the specified object is equal to the current object; otherwise, .
[EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => base.Equals(obj);
+ public override bool Equals(object obj)
+ => base.Equals(obj);
///
/// Serves as the default hash function.
///
/// A hash code for the current object.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => base.GetHashCode();
+ public override int GetHashCode()
+ => base.GetHashCode();
#endregion
}
diff --git a/src/EFCore/DbUpdateException.cs b/src/EFCore/DbUpdateException.cs
index 73ebe798f7c..bc026e1ef0a 100644
--- a/src/EFCore/DbUpdateException.cs
+++ b/src/EFCore/DbUpdateException.cs
@@ -92,6 +92,7 @@ public DbUpdateException([NotNull] SerializationInfo info, StreamingContext cont
/// Gets the entries that were involved in the error. Typically this is a single entry, but in some cases it
/// may be zero or multiple entries.
///
- public virtual IReadOnlyList Entries => _entries ??= new List();
+ public virtual IReadOnlyList Entries
+ => _entries ??= new List();
}
}
diff --git a/src/EFCore/Diagnostics/CoreEventId.cs b/src/EFCore/Diagnostics/CoreEventId.cs
index 1fc9d33b9b2..b5c7f3d3058 100644
--- a/src/EFCore/Diagnostics/CoreEventId.cs
+++ b/src/EFCore/Diagnostics/CoreEventId.cs
@@ -125,7 +125,9 @@ private enum Id
}
private static readonly string _updatePrefix = DbLoggerCategory.Update.Name + ".";
- private static EventId MakeUpdateId(Id id) => new EventId((int)id, _updatePrefix + id);
+
+ private static EventId MakeUpdateId(Id id)
+ => new EventId((int)id, _updatePrefix + id);
///
///
@@ -148,7 +150,9 @@ private enum Id
MakeUpdateId(Id.DuplicateDependentEntityTypeInstanceWarning);
private static readonly string _queryPrefix = DbLoggerCategory.Query.Name + ".";
- private static EventId MakeQueryId(Id id) => new EventId((int)id, _queryPrefix + id);
+
+ private static EventId MakeQueryId(Id id)
+ => new EventId((int)id, _queryPrefix + id);
///
///
@@ -269,7 +273,9 @@ public static readonly EventId FirstWithoutOrderByAndFilterWarning
= MakeQueryId(Id.FirstWithoutOrderByAndFilterWarning);
private static readonly string _infraPrefix = DbLoggerCategory.Infrastructure.Name + ".";
- private static EventId MakeInfraId(Id id) => new EventId((int)id, _infraPrefix + id);
+
+ private static EventId MakeInfraId(Id id)
+ => new EventId((int)id, _infraPrefix + id);
///
///
@@ -402,10 +408,14 @@ public static readonly EventId FirstWithoutOrderByAndFilterWarning
public static readonly EventId RedundantAddServicesCallWarning = MakeInfraId(Id.RedundantAddServicesCallWarning);
private static readonly string _modelPrefix = DbLoggerCategory.Model.Name + ".";
- private static EventId MakeModelId(Id id) => new EventId((int)id, _modelPrefix + id);
+
+ private static EventId MakeModelId(Id id)
+ => new EventId((int)id, _modelPrefix + id);
private static readonly string _modelValidationPrefix = DbLoggerCategory.Model.Validation.Name + ".";
- private static EventId MakeModelValidationId(Id id) => new EventId((int)id, _modelValidationPrefix + id);
+
+ private static EventId MakeModelValidationId(Id id)
+ => new EventId((int)id, _modelValidationPrefix + id);
///
///
@@ -518,7 +528,8 @@ public static readonly EventId FirstWithoutOrderByAndFilterWarning
///
///
[Obsolete]
- public static readonly EventId NonNullableReferenceOnBothNavigations = MakeModelId(Id.Obsolete_NonNullableReferenceOnBothNavigations);
+ public static readonly EventId NonNullableReferenceOnBothNavigations =
+ MakeModelId(Id.Obsolete_NonNullableReferenceOnBothNavigations);
///
///
@@ -723,8 +734,8 @@ public static readonly EventId FirstWithoutOrderByAndFilterWarning
///
///
- /// A attribute on the entity type is conflicting
- /// with a attribute on at least one of its properties.
+ /// A attribute on the entity type is conflicting
+ /// with a attribute on at least one of its properties.
///
///
/// This event is in the category.
@@ -734,7 +745,8 @@ public static readonly EventId FirstWithoutOrderByAndFilterWarning
/// .
///
///
- public static readonly EventId ConflictingKeylessAndKeyAttributesWarning = MakeModelId(Id.ConflictingKeylessAndKeyAttributesWarning);
+ public static readonly EventId ConflictingKeylessAndKeyAttributesWarning =
+ MakeModelId(Id.ConflictingKeylessAndKeyAttributesWarning);
///
///
@@ -753,7 +765,9 @@ public static readonly EventId PossibleIncorrectRequiredNavigationWithQueryFilte
= MakeModelValidationId(Id.PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning);
private static readonly string _changeTrackingPrefix = DbLoggerCategory.ChangeTracking.Name + ".";
- private static EventId MakeChangeTrackingId(Id id) => new EventId((int)id, _changeTrackingPrefix + id);
+
+ private static EventId MakeChangeTrackingId(Id id)
+ => new EventId((int)id, _changeTrackingPrefix + id);
///
///
diff --git a/src/EFCore/Diagnostics/CoreLoggerExtensions.cs b/src/EFCore/Diagnostics/CoreLoggerExtensions.cs
index c99b31c7cbe..8597d9e4639 100644
--- a/src/EFCore/Diagnostics/CoreLoggerExtensions.cs
+++ b/src/EFCore/Diagnostics/CoreLoggerExtensions.cs
@@ -57,7 +57,8 @@ public static void SaveChangesFailed(
exception);
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateDbContextErrorEventData(context, exception, definition);
@@ -75,7 +76,7 @@ public static void SaveChangesFailed(
/// The context in use.
/// The exception that caused this event.
/// The cancellation token.
- /// A for the async result.
+ /// A for the async result.
public static Task SaveChangesFailedAsync(
[NotNull] this IDiagnosticsLogger diagnostics,
[NotNull] DbContext context,
@@ -92,7 +93,8 @@ public static Task SaveChangesFailedAsync(
exception);
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateDbContextErrorEventData(context, exception, definition);
@@ -109,7 +111,9 @@ public static Task SaveChangesFailedAsync(
}
private static DbContextErrorEventData CreateDbContextErrorEventData(
- DbContext context, Exception exception, EventDefinition definition)
+ DbContext context,
+ Exception exception,
+ EventDefinition definition)
=> new DbContextErrorEventData(definition, SaveChangesFailed, context, exception);
private static string SaveChangesFailed(EventDefinitionBase definition, EventData payload)
@@ -137,7 +141,8 @@ public static void OptimisticConcurrencyException(
definition.Log(diagnostics, exception);
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateDbContextErrorEventData(context, exception, definition);
@@ -155,7 +160,7 @@ public static void OptimisticConcurrencyException(
/// The context in use.
/// The exception that caused this event.
/// The cancellation token.
- /// A for the async result.
+ /// A for the async result.
public static Task OptimisticConcurrencyExceptionAsync(
[NotNull] this IDiagnosticsLogger diagnostics,
[NotNull] DbContext context,
@@ -187,7 +192,9 @@ public static Task OptimisticConcurrencyExceptionAsync(
}
private static DbContextErrorEventData CreateDbContextErrorEventData(
- DbContext context, Exception exception, EventDefinition definition)
+ DbContext context,
+ Exception exception,
+ EventDefinition definition)
=> new DbContextErrorEventData(
definition,
OptimisticConcurrencyException,
@@ -216,7 +223,7 @@ public static void DuplicateDependentEntityTypeInstanceWarning(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,dependent1.DisplayName(), dependent2.DisplayName());
+ definition.Log(diagnostics, dependent1.DisplayName(), dependent2.DisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -587,7 +594,10 @@ private static string PossibleUnintendedReferenceComparisonWarning(EventDefiniti
/// Logs for the event.
///
/// The diagnostics logger to use.
- /// The navigation chain used in the
+ ///
+ /// The navigation chain used in the
+ ///
+ ///
/// The navigation name which was not found in the model.
public static void InvalidIncludePathError(
[NotNull] this IDiagnosticsLogger diagnostics,
@@ -863,7 +873,7 @@ public static void LazyLoadOnDisposedContextWarning(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,navigationName, entityType.GetType().ShortDisplayName());
+ definition.Log(diagnostics, navigationName, entityType.GetType().ShortDisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -903,7 +913,7 @@ public static void NavigationLazyLoading(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,navigationName, entityType.GetType().ShortDisplayName());
+ definition.Log(diagnostics, navigationName, entityType.GetType().ShortDisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -943,7 +953,7 @@ public static void DetachedLazyLoadingWarning(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,navigationName, entityType.GetType().ShortDisplayName());
+ definition.Log(diagnostics, navigationName, entityType.GetType().ShortDisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -985,9 +995,9 @@ public static void RedundantAddServicesCallWarning(
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = new ServiceProviderEventData(
- definition,
- (d, p) => ((EventDefinition)d).GenerateMessage(),
- serviceProvider);
+ definition,
+ (d, p) => ((EventDefinition)d).GenerateMessage(),
+ serviceProvider);
diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled);
}
@@ -1006,7 +1016,7 @@ public static void ShadowPropertyCreated(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,property.Name, property.DeclaringEntityType.DisplayName());
+ definition.Log(diagnostics, property.Name, property.DeclaringEntityType.DisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -1040,7 +1050,7 @@ public static void CollectionWithoutComparer(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,property.Name, property.DeclaringEntityType.DisplayName());
+ definition.Log(diagnostics, property.Name, property.DeclaringEntityType.DisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -1148,8 +1158,14 @@ private static string RedundantForeignKeyWarning(EventDefinitionBase definition,
/// Logs for the event.
///
/// The diagnostics logger to use.
- /// The name of the navigation property or entity type on the dependent end of the relationship.
- /// The name of the navigation property or entity type on the principal end of the relationship.
+ ///
+ /// The name of the navigation property or entity type on the dependent end of the
+ /// relationship.
+ ///
+ ///
+ /// The name of the navigation property or entity type on the principal end of the
+ /// relationship.
+ ///
/// The properties that make up the foreign key.
/// The corresponding keys on the principal side.
public static void IncompatibleMatchingForeignKeyProperties(
@@ -1997,10 +2013,7 @@ public static void ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning
var eventData = new TwoUnmappedPropertyCollectionsEventData(
definition,
ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning,
- new[]
- {
- new Tuple(navigation.GetIdentifyingMemberInfo(), navigation.DeclaringEntityType.ClrType)
- },
+ new[] { new Tuple(navigation.GetIdentifyingMemberInfo(), navigation.DeclaringEntityType.ClrType) },
new[] { new Tuple(property, property.DeclaringType) });
diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled);
@@ -2008,7 +2021,8 @@ public static void ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning
}
private static string ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning(
- EventDefinitionBase definition, EventData payload)
+ EventDefinitionBase definition,
+ EventData payload)
{
var d = (EventDefinition)definition;
var p = (TwoUnmappedPropertyCollectionsEventData)payload;
@@ -2068,7 +2082,7 @@ public static void DetectChangesCompleted(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,context.GetType().ShortDisplayName());
+ definition.Log(diagnostics, context.GetType().ShortDisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -2108,7 +2122,7 @@ public static void PropertyChangeDetected(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,property.DeclaringEntityType.ShortName(),property.Name);
+ definition.Log(diagnostics, property.DeclaringEntityType.ShortName(), property.Name);
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -2521,7 +2535,7 @@ public static void ReferenceChangeDetected(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,navigation.DeclaringEntityType.ShortName(),navigation.Name);
+ definition.Log(diagnostics, navigation.DeclaringEntityType.ShortName(), navigation.Name);
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -3089,10 +3103,11 @@ public static InterceptionResult SaveChangesStarting(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,context.GetType().ShortDisplayName());
+ definition.Log(diagnostics, context.GetType().ShortDisplayName());
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateSaveChangesStartingEventData(context, definition);
@@ -3124,10 +3139,11 @@ public static ValueTask> SaveChangesStartingAsync(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,context.GetType().ShortDisplayName());
+ definition.Log(diagnostics, context.GetType().ShortDisplayName());
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateSaveChangesStartingEventData(context, definition);
@@ -3172,10 +3188,11 @@ public static int SaveChangesCompleted(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,context.GetType().ShortDisplayName(), entitiesSavedCount);
+ definition.Log(diagnostics, context.GetType().ShortDisplayName(), entitiesSavedCount);
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateSaveChangesCompletedEventData(context, entitiesSavedCount, definition);
@@ -3209,10 +3226,11 @@ public static ValueTask SaveChangesCompletedAsync(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,context.GetType().ShortDisplayName(), entitiesSavedCount);
+ definition.Log(diagnostics, context.GetType().ShortDisplayName(), entitiesSavedCount);
}
- if (diagnostics.NeedsEventData(definition,
+ if (diagnostics.NeedsEventData(
+ definition,
out var interceptor, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
var eventData = CreateSaveChangesCompletedEventData(context, entitiesSavedCount, definition);
@@ -3229,7 +3247,9 @@ public static ValueTask SaveChangesCompletedAsync(
}
private static SaveChangesCompletedEventData CreateSaveChangesCompletedEventData(
- DbContext context, int entitiesSavedCount, EventDefinition definition)
+ DbContext context,
+ int entitiesSavedCount,
+ EventDefinition definition)
=> new SaveChangesCompletedEventData(
definition,
SaveChangesCompleted,
@@ -3258,7 +3278,7 @@ public static void ContextDisposed(
if (diagnostics.ShouldLog(definition))
{
- definition.Log(diagnostics,context.GetType().ShortDisplayName());
+ definition.Log(diagnostics, context.GetType().ShortDisplayName());
}
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
@@ -3345,7 +3365,9 @@ public static void PossibleIncorrectRequiredNavigationWithQueryFilterInteraction
}
}
- private static string PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning(EventDefinitionBase definition, EventData payload)
+ private static string PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning(
+ EventDefinitionBase definition,
+ EventData payload)
{
var d = (EventDefinition)definition;
var p = (ForeignKeyEventData)payload;
diff --git a/src/EFCore/Diagnostics/EventData.cs b/src/EFCore/Diagnostics/EventData.cs
index c21a15a6cc5..a05aceae5ed 100644
--- a/src/EFCore/Diagnostics/EventData.cs
+++ b/src/EFCore/Diagnostics/EventData.cs
@@ -32,22 +32,26 @@ public EventData(
///
/// The that defines the message ID and name.
///
- public virtual EventId EventId => _eventDefinition.EventId;
+ public virtual EventId EventId
+ => _eventDefinition.EventId;
///
/// The that would be used to log message for this event.
///
- public virtual LogLevel LogLevel => _eventDefinition.Level;
+ public virtual LogLevel LogLevel
+ => _eventDefinition.Level;
///
/// A string representing the code where this event is defined.
///
- public virtual string EventIdCode => _eventDefinition.EventIdCode;
+ public virtual string EventIdCode
+ => _eventDefinition.EventIdCode;
///
/// A logger message describing this event.
///
/// A logger message describing this event.
- public override string ToString() => _messageGenerator(_eventDefinition, this);
+ public override string ToString()
+ => _messageGenerator(_eventDefinition, this);
}
}
diff --git a/src/EFCore/Diagnostics/EventDefinitionBase.cs b/src/EFCore/Diagnostics/EventDefinitionBase.cs
index cc3ec0c0740..11150e259ca 100644
--- a/src/EFCore/Diagnostics/EventDefinitionBase.cs
+++ b/src/EFCore/Diagnostics/EventDefinitionBase.cs
@@ -85,9 +85,9 @@ protected virtual Exception WarningAsError([NotNull] string message)
CoreStrings.WarningAsErrorTemplate(EventId.ToString(), message, EventIdCode));
///
- /// The configured .
+ /// The configured .
///
- public virtual WarningBehavior WarningBehavior { get; }
+ public virtual WarningBehavior WarningBehavior { get; }
internal sealed class MessageExtractingLogger : ILogger
{
@@ -109,9 +109,11 @@ void ILogger.Log(
Message = formatter(state, exception);
}
- bool ILogger.IsEnabled(LogLevel logLevel) => true;
+ bool ILogger.IsEnabled(LogLevel logLevel)
+ => true;
- IDisposable ILogger.BeginScope([CanBeNull] TState state) => throw new NotImplementedException();
+ IDisposable ILogger.BeginScope([CanBeNull] TState state)
+ => throw new NotImplementedException();
}
}
}
diff --git a/src/EFCore/Diagnostics/ForeignKeyCandidateEventData.cs b/src/EFCore/Diagnostics/ForeignKeyCandidateEventData.cs
index 29c70cb6950..cbb49f78099 100644
--- a/src/EFCore/Diagnostics/ForeignKeyCandidateEventData.cs
+++ b/src/EFCore/Diagnostics/ForeignKeyCandidateEventData.cs
@@ -20,8 +20,14 @@ public class ForeignKeyCandidateEventData : TwoPropertyBaseCollectionsEventData
///
/// The event definition.
/// A delegate that generates a log message for this event.
- /// The name of the navigation property or entity type on the dependent end of the relationship.
- /// The name of the navigation property or entity type on the principal end of the relationship.
+ ///
+ /// The name of the navigation property or entity type on the dependent end of the
+ /// relationship.
+ ///
+ ///
+ /// The name of the navigation property or entity type on the principal end of the
+ /// relationship.
+ ///
/// The first property collection.
/// The second property collection.
public ForeignKeyCandidateEventData(
diff --git a/src/EFCore/Diagnostics/ICollectionChangedEventData.cs b/src/EFCore/Diagnostics/ICollectionChangedEventData.cs
index 8cb43bea98a..a3dddbbe8fe 100644
--- a/src/EFCore/Diagnostics/ICollectionChangedEventData.cs
+++ b/src/EFCore/Diagnostics/ICollectionChangedEventData.cs
@@ -8,7 +8,7 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics
{
///
/// An interface implemented by any subclass that represents a change to either
- /// a skip collection navigation or a regular collection navigation.
+ /// a skip collection navigation or a regular collection navigation.
///
public interface ICollectionChangedEventData
{
diff --git a/src/EFCore/Diagnostics/IDbContextLogger.cs b/src/EFCore/Diagnostics/IDbContextLogger.cs
index 293eff64aaa..5c9343f8ed8 100644
--- a/src/EFCore/Diagnostics/IDbContextLogger.cs
+++ b/src/EFCore/Diagnostics/IDbContextLogger.cs
@@ -33,7 +33,7 @@ public interface IDbContextLogger
///
/// The ID of the event.
/// The level of the event.
- /// Returns if the event should be logged; if it should be filtered out.
+ /// Returns if the event should be logged; if it should be filtered out.
bool ShouldLog(EventId eventId, LogLevel logLevel);
}
}
diff --git a/src/EFCore/Diagnostics/IDiagnosticsLogger.cs b/src/EFCore/Diagnostics/IDiagnosticsLogger.cs
index 6b63cced80c..c6590a86fe8 100644
--- a/src/EFCore/Diagnostics/IDiagnosticsLogger.cs
+++ b/src/EFCore/Diagnostics/IDiagnosticsLogger.cs
@@ -61,10 +61,13 @@ public interface IDiagnosticsLogger
IInterceptors Interceptors { get; }
///
- /// Checks whether or not the message should be sent to the .
+ /// Checks whether or not the message should be sent to the .
///
/// The definition of the event to log.
- /// if logging is enabled and the event should not be ignored; otherwise.
+ ///
+ /// if logging is enabled and the event should not be ignored;
+ /// otherwise.
+ ///
[MethodImpl(MethodImplOptions.AggressiveInlining)] // Because hot path for logging
bool ShouldLog([NotNull] EventDefinitionBase definition)
// No null checks; low-level code in hot path for logging.
@@ -78,8 +81,8 @@ bool ShouldLog([NotNull] EventDefinitionBase definition)
///
/// The definition of the event to log.
/// The event data.
- /// True to dispatch to a ; otherwise.
- /// True to dispatch to a ; otherwise.
+ /// True to dispatch to a ; otherwise.
+ /// True to dispatch to a ; otherwise.
[MethodImpl(MethodImplOptions.AggressiveInlining)] // Because hot path for logging
void DispatchEventData(
[NotNull] EventDefinitionBase definition,
@@ -106,9 +109,15 @@ void DispatchEventData(
/// the given event.
///
/// The definition of the event.
- /// Set to if a is enabled; otherwise.
- /// True to if a is enabled; otherwise.
- /// if either a diagnostic source or a LogTo logger is enabled; otherwise.
+ ///
+ /// Set to if a is enabled;
+ /// otherwise.
+ ///
+ ///
+ /// True to if a is enabled;
+ /// otherwise.
+ ///
+ /// if either a diagnostic source or a LogTo logger is enabled; otherwise.
[MethodImpl(MethodImplOptions.AggressiveInlining)] // Because hot path for logging
bool NeedsEventData(
[NotNull] EventDefinitionBase definition,
@@ -133,9 +142,18 @@ bool NeedsEventData(
///
/// The definition of the event.
/// The to use if enabled; otherwise null.
- /// Set to if a is enabled; otherwise.
- /// True to if a is enabled; otherwise.
- /// if either a diagnostic source, a LogTo logger, or an interceptor is enabled; otherwise.
+ ///
+ /// Set to if a is enabled;
+ /// otherwise.
+ ///
+ ///
+ /// True to if a is enabled;
+ /// otherwise.
+ ///
+ ///
+ /// if either a diagnostic source, a LogTo logger, or an interceptor is enabled;
+ /// otherwise.
+ ///
[MethodImpl(MethodImplOptions.AggressiveInlining)] // Because hot path for logging
bool NeedsEventData(
[NotNull] EventDefinitionBase definition,
diff --git a/src/EFCore/Diagnostics/INavigationBaseEventData.cs b/src/EFCore/Diagnostics/INavigationBaseEventData.cs
index dee078264ba..39a53002a39 100644
--- a/src/EFCore/Diagnostics/INavigationBaseEventData.cs
+++ b/src/EFCore/Diagnostics/INavigationBaseEventData.cs
@@ -6,7 +6,7 @@
namespace Microsoft.EntityFrameworkCore.Diagnostics
{
///
- /// A common interface for event payload classes that have an .
+ /// A common interface for event payload classes that have an .
///
public interface INavigationBaseEventData
{
diff --git a/src/EFCore/Diagnostics/ISaveChangesInterceptor.cs b/src/EFCore/Diagnostics/ISaveChangesInterceptor.cs
index 7749bc446af..c3788816be3 100644
--- a/src/EFCore/Diagnostics/ISaveChangesInterceptor.cs
+++ b/src/EFCore/Diagnostics/ISaveChangesInterceptor.cs
@@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics
{
///
///
- /// Allows interception of the and methods.
+ /// Allows interception of the and methods.
///
///
/// Command interceptors can be used to view, change, or suppress execution of the SaveChanges call and
@@ -33,10 +33,10 @@ public interface ISaveChangesInterceptor : IInterceptor
///
/// Called at the start of .
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// Represents the current result if one exists.
- /// This value will have set to if some previous
+ /// This value will have set to if some previous
/// interceptor suppressed execution by calling .
/// This value is typically used as the return value for the implementation of this method.
///
@@ -60,7 +60,7 @@ InterceptionResult SavingChanges(
/// In this case, is the result returned by .
///
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// The result of the call to .
/// This value is typically used as the return value for the implementation of this method.
@@ -75,7 +75,7 @@ int SavedChanges(
int result);
///
- /// Called when an exception has been thrown in .
+ /// Called when an exception has been thrown in .
///
/// Contextual information about the failure.
void SaveChangesFailed(
@@ -84,10 +84,10 @@ void SaveChangesFailed(
///
/// Called at the start of .
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// Represents the current result if one exists.
- /// This value will have set to if some previous
+ /// This value will have set to if some previous
/// interceptor suppressed execution by calling .
/// This value is typically used as the return value for the implementation of this method.
///
@@ -113,7 +113,7 @@ ValueTask> SavingChangesAsync(
/// In this case, is the result returned by .
///
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// The result of the call to .
/// This value is typically used as the return value for the implementation of this method.
@@ -129,9 +129,8 @@ ValueTask SavedChangesAsync(
int result,
CancellationToken cancellationToken = default);
-
///
- /// Called when an exception has been thrown in .
+ /// Called when an exception has been thrown in .
///
/// Contextual information about the failure.
/// The cancellation token.
diff --git a/src/EFCore/Diagnostics/InterceptionResult.cs b/src/EFCore/Diagnostics/InterceptionResult.cs
index 0b3ddab75f3..a789c3dbcd0 100644
--- a/src/EFCore/Diagnostics/InterceptionResult.cs
+++ b/src/EFCore/Diagnostics/InterceptionResult.cs
@@ -22,9 +22,11 @@ public readonly struct InterceptionResult
/// Creates a new instance indicating that
/// execution should be suppressed.
///
- public static InterceptionResult Suppress() => new InterceptionResult(true);
+ public static InterceptionResult Suppress()
+ => new InterceptionResult(true);
- private InterceptionResult(bool suppress) => IsSuppressed = suppress;
+ private InterceptionResult(bool suppress)
+ => IsSuppressed = suppress;
///
/// If true, then interception is suppressed.
diff --git a/src/EFCore/Diagnostics/InterceptionResult`.cs b/src/EFCore/Diagnostics/InterceptionResult`.cs
index 75e894a07e9..1e1994e26b8 100644
--- a/src/EFCore/Diagnostics/InterceptionResult`.cs
+++ b/src/EFCore/Diagnostics/InterceptionResult`.cs
@@ -48,7 +48,7 @@ private InterceptionResult(TResult result)
/// is the same as and
///
///
- /// when is .
+ /// when is .
public TResult Result
{
get
diff --git a/src/EFCore/Diagnostics/InterceptorAggregator.cs b/src/EFCore/Diagnostics/InterceptorAggregator.cs
index fc30a5c1ad8..2ddcceda03c 100644
--- a/src/EFCore/Diagnostics/InterceptorAggregator.cs
+++ b/src/EFCore/Diagnostics/InterceptorAggregator.cs
@@ -22,7 +22,8 @@ public abstract class InterceptorAggregator : IInterceptorAggregat
///
/// The interceptor type.
///
- public virtual Type InterceptorType => typeof(TInterceptor);
+ public virtual Type InterceptorType
+ => typeof(TInterceptor);
///
///
diff --git a/src/EFCore/Diagnostics/Internal/FormattingDbContextLogger.cs b/src/EFCore/Diagnostics/Internal/FormattingDbContextLogger.cs
index a9f9cb5ed16..69cb148f587 100644
--- a/src/EFCore/Diagnostics/Internal/FormattingDbContextLogger.cs
+++ b/src/EFCore/Diagnostics/Internal/FormattingDbContextLogger.cs
@@ -109,7 +109,8 @@ public virtual void Log(EventData eventData)
: messageBuilder
.AppendLine()
.Append(message)
- .Replace(Environment.NewLine, Environment.NewLine + padding, preambleLength, messageBuilder.Length - preambleLength)
+ .Replace(
+ Environment.NewLine, Environment.NewLine + padding, preambleLength, messageBuilder.Length - preambleLength)
.ToString();
}
}
diff --git a/src/EFCore/Diagnostics/Internal/NullDbContextLogger.cs b/src/EFCore/Diagnostics/Internal/NullDbContextLogger.cs
index 036e99b0cd2..03fa2205b8f 100644
--- a/src/EFCore/Diagnostics/Internal/NullDbContextLogger.cs
+++ b/src/EFCore/Diagnostics/Internal/NullDbContextLogger.cs
@@ -29,6 +29,7 @@ public virtual void Log(EventData eventData)
/// 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.
///
- public virtual bool ShouldLog(EventId eventId, LogLevel logLevel) => false;
+ public virtual bool ShouldLog(EventId eventId, LogLevel logLevel)
+ => false;
}
}
diff --git a/src/EFCore/Diagnostics/Internal/SaveChangesInterceptorAggregator.cs b/src/EFCore/Diagnostics/Internal/SaveChangesInterceptorAggregator.cs
index a1f94309ed7..26dac767328 100644
--- a/src/EFCore/Diagnostics/Internal/SaveChangesInterceptorAggregator.cs
+++ b/src/EFCore/Diagnostics/Internal/SaveChangesInterceptorAggregator.cs
@@ -63,7 +63,9 @@ public void SaveChangesFailed(DbContextErrorEventData eventData)
}
public async ValueTask> SavingChangesAsync(
- DbContextEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)
+ DbContextEventData eventData,
+ InterceptionResult result,
+ CancellationToken cancellationToken = default)
{
for (var i = 0; i < _interceptors.Length; i++)
{
@@ -74,7 +76,9 @@ public async ValueTask> SavingChangesAsync(
}
public async ValueTask SavedChangesAsync(
- SaveChangesCompletedEventData eventData, int result, CancellationToken cancellationToken = default)
+ SaveChangesCompletedEventData eventData,
+ int result,
+ CancellationToken cancellationToken = default)
{
for (var i = 0; i < _interceptors.Length; i++)
{
@@ -85,7 +89,8 @@ public async ValueTask SavedChangesAsync(
}
public async Task SaveChangesFailedAsync(
- DbContextErrorEventData eventData, CancellationToken cancellationToken = default)
+ DbContextErrorEventData eventData,
+ CancellationToken cancellationToken = default)
{
for (var i = 0; i < _interceptors.Length; i++)
{
diff --git a/src/EFCore/Diagnostics/LoggerCategory.cs b/src/EFCore/Diagnostics/LoggerCategory.cs
index d18228b6485..8c0345d2540 100644
--- a/src/EFCore/Diagnostics/LoggerCategory.cs
+++ b/src/EFCore/Diagnostics/LoggerCategory.cs
@@ -23,13 +23,15 @@ public abstract class LoggerCategory
/// The logger category name.
///
/// The logger category name.
- public override string ToString() => Name;
+ public override string ToString()
+ => Name;
///
/// The logger category name.
///
/// The category.
- public static implicit operator string([NotNull] LoggerCategory loggerCategory) => loggerCategory.ToString();
+ public static implicit operator string([NotNull] LoggerCategory loggerCategory)
+ => loggerCategory.ToString();
private static string ToName(Type loggerCategoryType)
{
diff --git a/src/EFCore/Diagnostics/NavigationBaseEventData.cs b/src/EFCore/Diagnostics/NavigationBaseEventData.cs
index 6984438a4aa..f958891c99a 100644
--- a/src/EFCore/Diagnostics/NavigationBaseEventData.cs
+++ b/src/EFCore/Diagnostics/NavigationBaseEventData.cs
@@ -9,7 +9,7 @@
namespace Microsoft.EntityFrameworkCore.Diagnostics
{
///
- /// A event payload class for events that have an .
+ /// A event payload class for events that have an .
///
public class NavigationBaseEventData : EventData, INavigationBaseEventData
{
diff --git a/src/EFCore/Diagnostics/NavigationEventData.cs b/src/EFCore/Diagnostics/NavigationEventData.cs
index 49d911cd7f4..2d3c36e4ad4 100644
--- a/src/EFCore/Diagnostics/NavigationEventData.cs
+++ b/src/EFCore/Diagnostics/NavigationEventData.cs
@@ -9,7 +9,7 @@
namespace Microsoft.EntityFrameworkCore.Diagnostics
{
///
- /// A event payload class for events that have an .
+ /// A event payload class for events that have an .
///
public class NavigationEventData : EventData, INavigationBaseEventData
{
@@ -36,6 +36,7 @@ public NavigationEventData(
///
/// The navigation.
///
- INavigationBase INavigationBaseEventData.NavigationBase => Navigation;
+ INavigationBase INavigationBaseEventData.NavigationBase
+ => Navigation;
}
}
diff --git a/src/EFCore/Diagnostics/SaveChangesInterceptor.cs b/src/EFCore/Diagnostics/SaveChangesInterceptor.cs
index d56889daef8..84069d77fa3 100644
--- a/src/EFCore/Diagnostics/SaveChangesInterceptor.cs
+++ b/src/EFCore/Diagnostics/SaveChangesInterceptor.cs
@@ -17,10 +17,10 @@ public abstract class SaveChangesInterceptor : ISaveChangesInterceptor
///
/// Called at the start of .
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// Represents the current result if one exists.
- /// This value will have set to if some previous
+ /// This value will have set to if some previous
/// interceptor suppressed execution by calling .
/// This value is typically used as the return value for the implementation of this method.
///
@@ -39,11 +39,12 @@ public virtual InterceptionResult SavingChanges(DbContextEventData eventDat
/// Called at the end of .
///
///
- /// This method is still called if an interceptor suppressed creation of a command in .
+ /// This method is still called if an interceptor suppressed creation of a command in
+ /// .
/// In this case, is the result returned by .
///
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// The result of the call to .
/// This value is typically used as the return value for the implementation of this method.
@@ -57,7 +58,7 @@ public virtual int SavedChanges(SaveChangesCompletedEventData eventData, int res
=> result;
///
- /// Called when an exception has been thrown in .
+ /// Called when an exception has been thrown in .
///
/// Contextual information about the failure.
public virtual void SaveChangesFailed(DbContextErrorEventData eventData)
@@ -67,10 +68,10 @@ public virtual void SaveChangesFailed(DbContextErrorEventData eventData)
///
/// Called at the start of .
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// Represents the current result if one exists.
- /// This value will have set to if some previous
+ /// This value will have set to if some previous
/// interceptor suppressed execution by calling .
/// This value is typically used as the return value for the implementation of this method.
///
@@ -93,11 +94,12 @@ public virtual ValueTask> SavingChangesAsync(
/// Called at the end of .
///
///
- /// This method is still called if an interceptor suppressed creation of a command in .
+ /// This method is still called if an interceptor suppressed creation of a command in
+ /// .
/// In this case, is the result returned by .
///
///
- /// Contextual information about the being used.
+ /// Contextual information about the being used.
///
/// The result of the call to .
/// This value is typically used as the return value for the implementation of this method.
@@ -115,7 +117,7 @@ public virtual ValueTask SavedChangesAsync(
=> new ValueTask(result);
///
- /// Called when an exception has been thrown in .
+ /// Called when an exception has been thrown in .
///
/// Contextual information about the failure.
/// The cancellation token.
diff --git a/src/EFCore/Diagnostics/SkipNavigationEventData.cs b/src/EFCore/Diagnostics/SkipNavigationEventData.cs
index 0e1fb208d78..968f8c29c1d 100644
--- a/src/EFCore/Diagnostics/SkipNavigationEventData.cs
+++ b/src/EFCore/Diagnostics/SkipNavigationEventData.cs
@@ -9,7 +9,7 @@
namespace Microsoft.EntityFrameworkCore.Diagnostics
{
///
- /// A event payload class for events that have an .
+ /// A event payload class for events that have an .
///
public class SkipNavigationEventData : EventData, INavigationBaseEventData
{
@@ -36,6 +36,7 @@ public SkipNavigationEventData(
///
/// The navigation.
///
- INavigationBase INavigationBaseEventData.NavigationBase => Navigation;
+ INavigationBase INavigationBaseEventData.NavigationBase
+ => Navigation;
}
}
diff --git a/src/EFCore/Diagnostics/WarningsConfiguration.cs b/src/EFCore/Diagnostics/WarningsConfiguration.cs
index ff70af7d546..7832bbe80e2 100644
--- a/src/EFCore/Diagnostics/WarningsConfiguration.cs
+++ b/src/EFCore/Diagnostics/WarningsConfiguration.cs
@@ -49,12 +49,14 @@ protected WarningsConfiguration([NotNull] WarningsConfiguration copyFrom)
/// Override this method in a derived class to ensure that any clone created is also of that class.
///
/// A clone of this instance, which can be modified before being returned as immutable.
- protected virtual WarningsConfiguration Clone() => new WarningsConfiguration(this);
+ protected virtual WarningsConfiguration Clone()
+ => new WarningsConfiguration(this);
///
/// The option set from the method.
///
- public virtual WarningBehavior DefaultBehavior => _defaultBehavior;
+ public virtual WarningBehavior DefaultBehavior
+ => _defaultBehavior;
///
/// Creates a new instance with all options the same as for this instance, but with the given option changed.
@@ -80,7 +82,8 @@ public virtual WarningsConfiguration WithDefaultBehavior(WarningBehavior warning
/// The behavior to set.
/// A new instance with the behaviors set.
public virtual WarningsConfiguration WithExplicit(
- [NotNull] IEnumerable eventIds, WarningBehavior warningBehavior)
+ [NotNull] IEnumerable eventIds,
+ WarningBehavior warningBehavior)
{
var clone = Clone();
@@ -134,7 +137,7 @@ public virtual WarningsConfiguration WithExplicit(
: null;
///
- /// Gets the set for the given event ID, or
+ /// Gets the set for the given event ID, or
/// if no explicit behavior has been set.
///
/// The set for the given event ID.
diff --git a/src/EFCore/Extensions/ConventionAnnotatableExtensions.cs b/src/EFCore/Extensions/ConventionAnnotatableExtensions.cs
index f65f9d6a627..7638e690294 100644
--- a/src/EFCore/Extensions/ConventionAnnotatableExtensions.cs
+++ b/src/EFCore/Extensions/ConventionAnnotatableExtensions.cs
@@ -22,7 +22,8 @@ public static class ConventionAnnotatableExtensions
/// The key of the annotation to find.
/// The annotation with the specified name.
public static IConventionAnnotation GetAnnotation(
- [NotNull] this IConventionAnnotatable annotatable, [NotNull] string annotationName)
+ [NotNull] this IConventionAnnotatable annotatable,
+ [NotNull] string annotationName)
=> (IConventionAnnotation)((IAnnotatable)annotatable).GetAnnotation(annotationName);
///
diff --git a/src/EFCore/Extensions/ConventionEntityTypeExtensions.cs b/src/EFCore/Extensions/ConventionEntityTypeExtensions.cs
index 0ad132b0c7c..dd9ce0d576f 100644
--- a/src/EFCore/Extensions/ConventionEntityTypeExtensions.cs
+++ b/src/EFCore/Extensions/ConventionEntityTypeExtensions.cs
@@ -259,7 +259,8 @@ public static IEnumerable GetDerivedForeignKeys([NotNull]
/// The property to find the foreign keys on.
/// The foreign keys.
public static IEnumerable FindForeignKeys(
- [NotNull] this IConventionEntityType entityType, [NotNull] IProperty property)
+ [NotNull] this IConventionEntityType entityType,
+ [NotNull] IProperty property)
=> entityType.FindForeignKeys(new[] { property });
///
@@ -270,7 +271,8 @@ public static IEnumerable FindForeignKeys(
/// The properties to find the foreign keys on.
/// The foreign keys.
public static IEnumerable FindForeignKeys(
- [NotNull] this IConventionEntityType entityType, [NotNull] IReadOnlyList properties)
+ [NotNull] this IConventionEntityType entityType,
+ [NotNull] IReadOnlyList properties)
=> ((EntityType)entityType).FindForeignKeys(properties);
///
@@ -382,7 +384,8 @@ public static IConventionForeignKey RemoveForeignKey(
/// The navigation property on the entity class.
/// The navigation property, or if none is found.
public static IConventionNavigation FindNavigation(
- [NotNull] this IConventionEntityType entityType, [NotNull] MemberInfo memberInfo)
+ [NotNull] this IConventionEntityType entityType,
+ [NotNull] MemberInfo memberInfo)
=> Check.NotNull(entityType, nameof(entityType))
.FindNavigation(Check.NotNull(memberInfo, nameof(memberInfo)).GetSimpleMemberName());
@@ -492,7 +495,8 @@ public static IConventionProperty AddProperty(
/// Indicates whether the configuration was specified using a data annotation.
/// The newly created property.
public static IConventionProperty AddProperty(
- [NotNull] this IConventionEntityType entityType, [NotNull] string name,
+ [NotNull] this IConventionEntityType entityType,
+ [NotNull] string name,
bool fromDataAnnotation = false)
=> ((EntityType)entityType).AddProperty(
name, fromDataAnnotation ? ConfigurationSource.DataAnnotation : ConfigurationSource.Convention);
@@ -507,8 +511,11 @@ public static IConventionProperty AddProperty(
/// Indicates whether the configuration was specified using a data annotation.
/// The newly created property.
public static IConventionProperty AddProperty(
- [NotNull] this IConventionEntityType entityType, [NotNull] string name, [NotNull] Type propertyType,
- bool setTypeConfigurationSource = true, bool fromDataAnnotation = false)
+ [NotNull] this IConventionEntityType entityType,
+ [NotNull] string name,
+ [NotNull] Type propertyType,
+ bool setTypeConfigurationSource = true,
+ bool fromDataAnnotation = false)
=> ((EntityType)entityType).AddProperty(
name,
propertyType,
@@ -527,8 +534,11 @@ public static IConventionProperty AddProperty(
/// Indicates whether the configuration was specified using a data annotation.
/// The newly created property.
public static IConventionProperty AddIndexerProperty(
- [NotNull] this IConventionEntityType entityType, [NotNull] string name, [NotNull] Type propertyType,
- bool setTypeConfigurationSource = true, bool fromDataAnnotation = false)
+ [NotNull] this IConventionEntityType entityType,
+ [NotNull] string name,
+ [NotNull] Type propertyType,
+ bool setTypeConfigurationSource = true,
+ bool fromDataAnnotation = false)
{
Check.NotNull(entityType, nameof(entityType));
@@ -544,7 +554,7 @@ public static IConventionProperty AddIndexerProperty(
///
///
- /// Gets the unnamed index defined on the given property. Returns if no such index is defined.
+ /// Gets the unnamed index defined on the given property. Returns if no such index is defined.
///
///
/// Named indexes will not be returned even if the list of properties matches.
@@ -673,7 +683,9 @@ public static IConventionProperty GetDiscriminatorProperty([NotNull] this IConve
/// Indicates whether the configuration was specified using a data annotation.
/// The discriminator property.
public static IConventionProperty SetDiscriminatorProperty(
- [NotNull] this IConventionEntityType entityType, [CanBeNull] IProperty property, bool fromDataAnnotation = false)
+ [NotNull] this IConventionEntityType entityType,
+ [CanBeNull] IProperty property,
+ bool fromDataAnnotation = false)
=> Check.NotNull(entityType, nameof(entityType)).AsEntityType()
.SetDiscriminatorProperty(
(Property)property,
@@ -696,7 +708,9 @@ public static IConventionProperty SetDiscriminatorProperty(
/// Indicates whether the configuration was specified using a data annotation.
/// The configured value.
public static bool? SetDiscriminatorMappingComplete(
- [NotNull] this IConventionEntityType entityType, bool? complete, bool fromDataAnnotation = false)
+ [NotNull] this IConventionEntityType entityType,
+ bool? complete,
+ bool fromDataAnnotation = false)
{
Check.NotNull(entityType, nameof(entityType));
@@ -710,7 +724,8 @@ public static IConventionProperty SetDiscriminatorProperty(
///
/// The entity type.
/// The or if discriminator completeness has not been set.
- public static ConfigurationSource? GetDiscriminatorMappingCompleteConfigurationSource([NotNull] this IConventionEntityType entityType)
+ public static ConfigurationSource? GetDiscriminatorMappingCompleteConfigurationSource(
+ [NotNull] this IConventionEntityType entityType)
=> entityType.FindAnnotation(CoreAnnotationNames.DiscriminatorMappingComplete)
?.GetConfigurationSource();
@@ -722,7 +737,9 @@ public static IConventionProperty SetDiscriminatorProperty(
/// Indicates whether the configuration was specified using a data annotation.
/// The configured value.
public static object SetDiscriminatorValue(
- [NotNull] this IConventionEntityType entityType, [CanBeNull] object value, bool fromDataAnnotation = false)
+ [NotNull] this IConventionEntityType entityType,
+ [CanBeNull] object value,
+ bool fromDataAnnotation = false)
{
entityType.AsEntityType().CheckDiscriminatorValue(entityType, value);
diff --git a/src/EFCore/Extensions/ConventionForeignKeyExtensions.cs b/src/EFCore/Extensions/ConventionForeignKeyExtensions.cs
index af3ef7fa168..d040fb35112 100644
--- a/src/EFCore/Extensions/ConventionForeignKeyExtensions.cs
+++ b/src/EFCore/Extensions/ConventionForeignKeyExtensions.cs
@@ -19,7 +19,8 @@ public static class ConventionForeignKeyExtensions
/// One of the entity types related by the foreign key.
/// The entity type related to the given one.
public static IConventionEntityType GetRelatedEntityType(
- [NotNull] this IConventionForeignKey foreignKey, [NotNull] IConventionEntityType entityType)
+ [NotNull] this IConventionForeignKey foreignKey,
+ [NotNull] IConventionEntityType entityType)
=> (IConventionEntityType)((IForeignKey)foreignKey).GetRelatedEntityType(entityType);
///
diff --git a/src/EFCore/Extensions/ConventionModelExtensions.cs b/src/EFCore/Extensions/ConventionModelExtensions.cs
index 9ddccaccb12..392115faece 100644
--- a/src/EFCore/Extensions/ConventionModelExtensions.cs
+++ b/src/EFCore/Extensions/ConventionModelExtensions.cs
@@ -60,7 +60,8 @@ public static IReadOnlyCollection GetEntityTypes([NotNull
/// The entity types found.
[DebuggerStepThrough]
public static IReadOnlyCollection GetEntityTypes(
- [NotNull] this IConventionModel model, [NotNull] string name)
+ [NotNull] this IConventionModel model,
+ [NotNull] string name)
=> ((Model)model).GetEntityTypes(name);
///
@@ -272,7 +273,8 @@ public static bool IsIgnored([NotNull] this IConventionModel model, [NotNull] Ty
/// otherwise.
///
public static ConfigurationSource? FindIgnoredConfigurationSource(
- [NotNull] this IConventionModel model, [NotNull] Type type)
+ [NotNull] this IConventionModel model,
+ [NotNull] Type type)
=> Check.NotNull((Model)model, nameof(model)).FindIgnoredConfigurationSource(
Check.NotNull(type, nameof(type)));
@@ -318,6 +320,7 @@ public static void AddShared([NotNull] this IConventionModel model, [NotNull] Ty
///
/// The model to finalize.
/// The finalized .
- public static IModel FinalizeModel([NotNull] this IConventionModel model) => ((Model)model).FinalizeModel();
+ public static IModel FinalizeModel([NotNull] this IConventionModel model)
+ => ((Model)model).FinalizeModel();
}
}
diff --git a/src/EFCore/Extensions/ConventionPropertyExtensions.cs b/src/EFCore/Extensions/ConventionPropertyExtensions.cs
index a1cc5af56bf..b551859f6a6 100644
--- a/src/EFCore/Extensions/ConventionPropertyExtensions.cs
+++ b/src/EFCore/Extensions/ConventionPropertyExtensions.cs
@@ -66,7 +66,7 @@ public static IEnumerable GetContainingIndexes([NotNull] this
///
/// The property to get primary key for.
///
- /// The primary that use this property, or if it is not part of the primary key.
+ /// The primary that use this property, or if it is not part of the primary key.
///
public static IConventionKey FindContainingPrimaryKey([NotNull] this IConventionProperty property)
=> (IConventionKey)((IProperty)property).FindContainingPrimaryKey();
@@ -112,7 +112,9 @@ public static CoreTypeMapping SetTypeMapping(
/// Indicates whether the configuration was specified using a data annotation.
/// The configured property.
public static int? SetMaxLength(
- [NotNull] this IConventionProperty property, int? maxLength, bool fromDataAnnotation = false)
+ [NotNull] this IConventionProperty property,
+ int? maxLength,
+ bool fromDataAnnotation = false)
=> property.AsProperty().SetMaxLength(
maxLength, fromDataAnnotation ? ConfigurationSource.DataAnnotation : ConfigurationSource.Convention);
@@ -169,12 +171,15 @@ public static CoreTypeMapping SetTypeMapping(
///
/// The property to set the value for.
///
- /// if the property accepts Unicode characters, if it does not, to clear the setting.
+ /// if the property accepts Unicode characters, if it does not, to
+ /// clear the setting.
///
/// Indicates whether the configuration was specified using a data annotation.
/// The configured value.
public static bool? SetIsUnicode(
- [NotNull] this IConventionProperty property, bool? unicode, bool fromDataAnnotation = false)
+ [NotNull] this IConventionProperty property,
+ bool? unicode,
+ bool fromDataAnnotation = false)
=> property.AsProperty().SetIsUnicode(
unicode, fromDataAnnotation ? ConfigurationSource.DataAnnotation : ConfigurationSource.Convention);
@@ -209,7 +214,9 @@ public static CoreTypeMapping SetTypeMapping(
/// Indicates whether the configuration was specified using a data annotation.
/// The configured value.
public static PropertySaveBehavior? SetBeforeSaveBehavior(
- [NotNull] this IConventionProperty property, PropertySaveBehavior? beforeSaveBehavior, bool fromDataAnnotation = false)
+ [NotNull] this IConventionProperty property,
+ PropertySaveBehavior? beforeSaveBehavior,
+ bool fromDataAnnotation = false)
=> property.AsProperty().SetBeforeSaveBehavior(
beforeSaveBehavior, fromDataAnnotation ? ConfigurationSource.DataAnnotation : ConfigurationSource.Convention);
@@ -243,7 +250,9 @@ public static CoreTypeMapping SetTypeMapping(
/// Indicates whether the configuration was specified using a data annotation.
/// The configured value.
public static PropertySaveBehavior? SetAfterSaveBehavior(
- [NotNull] this IConventionProperty property, PropertySaveBehavior? afterSaveBehavior, bool fromDataAnnotation = false)
+ [NotNull] this IConventionProperty property,
+ PropertySaveBehavior? afterSaveBehavior,
+ bool fromDataAnnotation = false)
=> property.AsProperty().SetAfterSaveBehavior(
afterSaveBehavior, fromDataAnnotation ? ConfigurationSource.DataAnnotation : ConfigurationSource.Convention);
diff --git a/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs b/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs
index 4aaa204a249..70d6e552e44 100644
--- a/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs
+++ b/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs
@@ -36,7 +36,7 @@ public static class EntityFrameworkQueryableExtensions
/// The query source.
/// The query string for debugging.
///
- /// is .
+ /// is .
///
public static string ToQueryString([NotNull] this IQueryable source)
{
@@ -70,7 +70,7 @@ public static string ToQueryString([NotNull] this IQueryable source)
/// The task result contains if the source sequence contains any elements; otherwise, .
///
///
- /// is .
+ /// is .
///
public static Task AnyAsync(
[NotNull] this IQueryable source,
@@ -104,7 +104,7 @@ public static Task AnyAsync(
/// predicate; otherwise, .
///
///
- /// or is .
+ /// or is .
///
public static Task AnyAsync(
[NotNull] this IQueryable source,
@@ -140,7 +140,7 @@ public static Task AnyAsync(
/// predicate; otherwise, .
///
///
- /// or is .
+ /// or is .
///
public static Task AllAsync(
[NotNull] this IQueryable source,
@@ -178,7 +178,7 @@ public static Task AllAsync(
/// The task result contains the number of elements in the input sequence.
///
///
- /// is .
+ /// is .
///
public static Task CountAsync(
[NotNull] this IQueryable source,
@@ -212,7 +212,7 @@ public static Task CountAsync(
/// function.
///
///
- /// or is .
+ /// or is .
///
public static Task CountAsync(
[NotNull] this IQueryable source,
@@ -246,7 +246,7 @@ public static Task CountAsync(
/// The task result contains the number of elements in the input sequence.
///
///
- /// is .
+ /// is .
///
public static Task LongCountAsync(
[NotNull] this IQueryable source,
@@ -281,7 +281,7 @@ public static Task LongCountAsync(
/// function.
///
///
- /// or is .
+ /// or is .
///
public static Task LongCountAsync(
[NotNull] this IQueryable source,
@@ -319,10 +319,10 @@ public static Task LongCountAsync(
/// The task result contains the first element in .
///
///
- /// is .
+ /// is .
///
///
- /// contains no elements.
+ /// contains no elements.
///
public static Task FirstAsync(
[NotNull] this IQueryable source,
@@ -356,17 +356,17 @@ public static Task FirstAsync(
/// .
///
///
- /// or is .
+ /// or is .
///
///
///
- /// No element satisfies the condition in
+ /// No element satisfies the condition in
///
///
/// -or -
///
///
- /// contains no elements.
+ /// contains no elements.
///
///
public static Task FirstAsync(
@@ -402,7 +402,7 @@ public static Task FirstAsync(
/// is empty; otherwise, the first element in .
///
///
- /// is .
+ /// is .
///
public static Task FirstOrDefaultAsync(
[NotNull] this IQueryable source,
@@ -438,7 +438,7 @@ public static Task FirstOrDefaultAsync(
/// element in that passes the test specified by .
///
///
- /// or is .
+ /// or is .
///
public static Task FirstOrDefaultAsync(
[NotNull] this IQueryable source,
@@ -476,10 +476,10 @@ public static Task FirstOrDefaultAsync(
/// The task result contains the last element in .
///
///
- /// is .
+ /// is .
///
///
- /// contains no elements.
+ /// contains no elements.
///
public static Task LastAsync(
[NotNull] this IQueryable source,
@@ -513,17 +513,17 @@ public static Task LastAsync(
/// .
///
///
- /// or is .
+ /// or is .
///
///
///
- /// No element satisfies the condition in .
+ /// No element satisfies the condition in .
///
///
/// -or-
///
///
- /// contains no elements.
+ /// contains no elements.
///
///
public static Task LastAsync(
@@ -559,7 +559,7 @@ public static Task LastAsync(
/// is empty; otherwise, the last element in .
///
///
- /// is .
+ /// is .
///
public static Task LastOrDefaultAsync(
[NotNull] this IQueryable source,
@@ -595,7 +595,7 @@ public static Task LastOrDefaultAsync(
/// element in that passes the test specified by .
///
///
- /// or is .
+ /// or is .
///
public static Task LastOrDefaultAsync(
[NotNull] this IQueryable source,
@@ -634,17 +634,17 @@ public static Task LastOrDefaultAsync(
/// The task result contains the single element of the input sequence.
///
///
- /// is .
+ /// is .
///
///
///
- /// contains more than one elements.
+ /// contains more than one elements.
///
///
/// -or-
///
///
- /// contains no elements.
+ /// contains no elements.
///
///
public static Task SingleAsync(
@@ -680,23 +680,23 @@ public static Task SingleAsync(
/// .
///
///
- /// or is .
+ /// or is .
///
///
///
- /// No element satisfies the condition in .
+ /// No element satisfies the condition in .
///
///
/// -or-
///
///
- /// More than one element satisfies the condition in .
+ /// More than one element satisfies the condition in .
///
///
/// -or-
///
///
- /// contains no elements.
+ /// contains no elements.
///
///
public static Task SingleAsync(
@@ -734,10 +734,10 @@ public static Task SingleAsync(
/// if the sequence contains no elements.
///
///
- /// is .
+ /// is .
///
///
- /// contains more than one element.
+ /// contains more than one element.
///
public static Task SingleOrDefaultAsync(
[NotNull] this IQueryable source,
@@ -773,10 +773,10 @@ public static Task SingleOrDefaultAsync(
/// , or ( ) if no such element is found.
///
///
- /// or is .
+ /// or is .
///
///
- /// More than one element satisfies the condition in .
+ /// More than one element satisfies the condition in .
///
public static Task SingleOrDefaultAsync(
[NotNull] this IQueryable source,
@@ -815,7 +815,7 @@ public static Task SingleOrDefaultAsync(
/// The task result contains the minimum value in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task MinAsync(
[NotNull] this IQueryable source,
@@ -851,7 +851,7 @@ public static Task MinAsync(
/// The task result contains the minimum value in the sequence.
///
///
- /// or is .
+ /// or is .
///
public static Task MinAsync(
[NotNull] this IQueryable source,
@@ -889,7 +889,7 @@ public static Task MinAsync(
/// The task result contains the maximum value in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task MaxAsync(
[NotNull] this IQueryable source,
@@ -925,7 +925,7 @@ public static Task MaxAsync(
/// The task result contains the maximum value in the sequence.
///
///
- /// or is .
+ /// or is .
///
public static Task MaxAsync(
[NotNull] this IQueryable source,
@@ -960,7 +960,7 @@ public static Task MaxAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -989,7 +989,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1021,7 +1021,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1055,7 +1055,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1087,7 +1087,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1116,7 +1116,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1147,7 +1147,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1180,7 +1180,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1212,7 +1212,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1241,7 +1241,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1272,7 +1272,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1306,7 +1306,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1338,7 +1338,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1367,7 +1367,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1398,7 +1398,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1432,7 +1432,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1464,7 +1464,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1493,7 +1493,7 @@ public static Task SumAsync(
/// The task result contains the sum of the values in the sequence.
///
///
- /// is .
+ /// is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1524,7 +1524,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1558,7 +1558,7 @@ public static Task SumAsync(
/// The task result contains the sum of the projected values..
///
///
- /// or is .
+ /// or is .
///
public static Task SumAsync(
[NotNull] this IQueryable source,
@@ -1594,10 +1594,10 @@ public static Task SumAsync(
/// The task result contains the average of the sequence of values.
///
///
- /// is .
+ /// is .
///
///
- /// contains no elements.
+ /// contains no elements.
///
public static Task AverageAsync(
[NotNull] this IQueryable source,
@@ -1627,7 +1627,7 @@ public static Task AverageAsync(
/// The task result contains the average of the sequence of values.
///
///
- /// is .
+ /// is .
///
public static Task AverageAsync(
[NotNull] this IQueryable source,
@@ -1660,10 +1660,10 @@ public static Task AverageAsync(
/// The task result contains the average of the projected values.
///
///
- /// or is .
+ /// or is .
///
///
- /// contains no elements.
+ /// contains no elements.
///
public static Task AverageAsync(
[NotNull] this IQueryable source,
@@ -1698,7 +1698,7 @@ public static Task AverageAsync(
/// The task result contains the average of the projected values.
///
///
- /// or is .
+ /// or is .
///
public static Task AverageAsync(
[NotNull] this IQueryable source,
@@ -1730,10 +1730,10 @@ public static Task AverageAsync(
/// The task result contains the average of the sequence of values.
///
///
- /// is .
+ /// is .
///
///
- /// contains no elements.
+ /// contains no elements.
///
public static Task AverageAsync(
[NotNull] this IQueryable source,
@@ -1762,7 +1762,7 @@ public static Task AverageAsync(
/// The task result contains the average of the sequence of values.
///
///
- /// is .
+ /// is .
///
public static Task AverageAsync(
[NotNull] this IQueryable source,
@@ -1794,10 +1794,10 @@ public static Task AverageAsync(
/// The task result contains the average of the projected values.
///
///
- ///