Skip to content

Commit

Permalink
dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers committed Sep 23, 2021
1 parent a5fde13 commit c63d482
Show file tree
Hide file tree
Showing 30 changed files with 138 additions and 86 deletions.
3 changes: 2 additions & 1 deletion src/EFCore/ChangeTracking/Internal/EntryPropertyValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public override void SetValues(PropertyValues propertyValues)
/// </summary>
public override IReadOnlyList<IProperty> Properties
{
[DebuggerStepThrough] get => _properties ??= EntityType.GetProperties().ToList();
[DebuggerStepThrough]
get => _properties ??= EntityType.GetProperties().ToList();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ public void HandleINotifyCollectionChanged(
break;
case NotifyCollectionChangedAction.Reset:
throw new InvalidOperationException(CoreStrings.ResetNotSupported);
// Note: ignoring Move since index not important
// Note: ignoring Move since index not important
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void SetValue(IPropertyBase propertyBase, object? value)

Check.DebugAssert(!IsEmpty, "relationship snapshot is empty");
Check.DebugAssert(
propertyBase is not INavigation { IsCollection : true },
propertyBase is not INavigation { IsCollection: true },
$"property {propertyBase} is is not reference navigation");

_values[propertyBase.GetRelationshipIndex()] = SnapshotValue(propertyBase, value);
Expand Down
6 changes: 1 addition & 5 deletions src/EFCore/ChangeTracking/Internal/Snapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5049,11 +5049,7 @@ public T GetValue<T>(int index)
/// </summary>
public object? this[int index]
{
get => index switch
{
0 => _value0,
_ => throw new IndexOutOfRangeException(),
};
get => index == 0 ? _value0 : throw new IndexOutOfRangeException();
set => _value0 = index switch
{
0 => (T0)value!,
Expand Down
3 changes: 2 additions & 1 deletion src/EFCore/ChangeTracking/PropertyValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public virtual void SetValues<TProperty>(IDictionary<string, TProperty> values)
/// </summary>
public virtual IEntityType EntityType
{
[DebuggerStepThrough] get => InternalEntry.EntityType;
[DebuggerStepThrough]
get => InternalEntry.EntityType;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/DbContextOptions`.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override DbContextOptions WithExtension<TExtension>(TExtension extension)
var ordinal = ExtensionsMap.Count;
if (ExtensionsMap.TryGetValue(type, out var existingValue))
{
ordinal = existingValue.Ordinal;
ordinal = existingValue.Ordinal;
}

return new DbContextOptions<TContext>(ExtensionsMap.SetItem(type, (extension, ordinal)));
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3056,8 +3056,8 @@ source.Provider is EntityQueryProvider
/// </exception>
public static IQueryable<T> TagWithCallSite<T>(
this IQueryable<T> source,
[NotParameterized] [CallerFilePath] string? filePath = null,
[NotParameterized] [CallerLineNumber] int lineNumber = 0)
[NotParameterized][CallerFilePath] string? filePath = null,
[NotParameterized][CallerLineNumber] int lineNumber = 0)
{
Check.NotNull(source, nameof(source));

Expand Down
6 changes: 4 additions & 2 deletions src/EFCore/Infrastructure/AnnotatableBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,15 @@ public virtual void MergeAnnotationsFrom(TMetadata annotatable, ConfigurationSou
/// <inheritdoc />
IConventionModelBuilder IConventionAnnotatableBuilder.ModelBuilder
{
[DebuggerStepThrough] get => ModelBuilder;
[DebuggerStepThrough]
get => ModelBuilder;
}

/// <inheritdoc />
IConventionAnnotatable IConventionAnnotatableBuilder.Metadata
{
[DebuggerStepThrough] get => Metadata;
[DebuggerStepThrough]
get => Metadata;
}

/// <inheritdoc />
Expand Down
20 changes: 12 additions & 8 deletions src/EFCore/Infrastructure/EntityFrameworkEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ protected override void OnEventCommand(EventCommandEventArgs command)
};

_totalQueriesCounter ??= new PollingCounter("total-queries", this, () => Interlocked.Read(ref _totalQueries))
{ DisplayName = "Queries (Total)" };
{ DisplayName = "Queries (Total)" };

_queriesPerSecondCounter ??= new IncrementingPollingCounter(
"queries-per-second",
this,
() => Interlocked.Read(ref _totalQueries)) { DisplayName = "Queries", DisplayRateTimeScale = TimeSpan.FromSeconds(1) };
() => Interlocked.Read(ref _totalQueries))
{ DisplayName = "Queries", DisplayRateTimeScale = TimeSpan.FromSeconds(1) };

_totalSaveChangesCounter ??= new PollingCounter("total-save-changes", this, () => Interlocked.Read(ref _totalSaveChanges))
{
Expand All @@ -153,39 +154,42 @@ protected override void OnEventCommand(EventCommandEventArgs command)
"save-changes-per-second",
this,
() => Interlocked.Read(ref _totalSaveChanges))
{ DisplayName = "SaveChanges", DisplayRateTimeScale = TimeSpan.FromSeconds(1) };
{ DisplayName = "SaveChanges", DisplayRateTimeScale = TimeSpan.FromSeconds(1) };

_compiledQueryCacheHitRateCounter ??= new PollingCounter(
"compiled-query-cache-hit-rate",
this,
() => _compiledQueryCacheInfo.CalculateAndReset()) { DisplayName = "Query Cache Hit Rate", DisplayUnits = "%" };
() => _compiledQueryCacheInfo.CalculateAndReset())
{ DisplayName = "Query Cache Hit Rate", DisplayUnits = "%" };

_totalExecutionStrategyOperationFailuresCounter ??= new PollingCounter(
"total-execution-strategy-operation-failures",
this,
() => Interlocked.Read(ref _totalExecutionStrategyOperationFailures))
{ DisplayName = "Execution Strategy Operation Failures (Total)" };
{ DisplayName = "Execution Strategy Operation Failures (Total)" };

_executionStrategyOperationFailuresPerSecondCounter ??= new IncrementingPollingCounter(
"execution-strategy-operation-failures-per-second",
this,
() => Interlocked.Read(ref _totalExecutionStrategyOperationFailures))
{
DisplayName = "Execution Strategy Operation Failures", DisplayRateTimeScale = TimeSpan.FromSeconds(1)
DisplayName = "Execution Strategy Operation Failures",
DisplayRateTimeScale = TimeSpan.FromSeconds(1)
};

_totalOptimisticConcurrencyFailuresCounter ??= new PollingCounter(
"total-optimistic-concurrency-failures",
this,
() => Interlocked.Read(ref _totalOptimisticConcurrencyFailures))
{ DisplayName = "Optimistic Concurrency Failures (Total)" };
{ DisplayName = "Optimistic Concurrency Failures (Total)" };

_optimisticConcurrencyFailuresPerSecondCounter ??= new IncrementingPollingCounter(
"optimistic-concurrency-failures-per-second",
this,
() => Interlocked.Read(ref _totalOptimisticConcurrencyFailures))
{
DisplayName = "Optimistic Concurrency Failures", DisplayRateTimeScale = TimeSpan.FromSeconds(1)
DisplayName = "Optimistic Concurrency Failures",
DisplayRateTimeScale = TimeSpan.FromSeconds(1)
};
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/EFCore/Infrastructure/ExpressionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,9 @@ public static Expression CreateKeyValuesExpression(
/// <param name="makeNullable"> A value indicating if the value can be nullable. </param>
/// <returns> An expression to access EF property on given expression. </returns>
public static Expression CreateEFPropertyExpression(
this Expression target,
IPropertyBase property,
bool makeNullable = true)
// No shadow entities in runtime
this Expression target,
IPropertyBase property,
bool makeNullable = true) // No shadow entities in runtime
=> CreateEFPropertyExpression(target, property.DeclaringType.ClrType, property.ClrType, property.Name, makeNullable);

private static Expression CreateEFPropertyExpression(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private IReadOnlyList<RelationshipCandidate> FindRelationshipCandidates(
new RelationshipCandidate(
candidateTargetEntityTypeBuilder, navigations, inverseNavigationCandidates, shouldBeOwnership);

Continue: ;
Continue:;
}

return UpdateTargetEntityTypes(entityTypeBuilder, relationshipCandidates);
Expand Down
1 change: 0 additions & 1 deletion src/EFCore/Metadata/IEntityType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public interface IEntityType : IReadOnlyEntityType, ITypeBase
/// <summary>
/// Gets the primary or alternate key that is defined on the given property. Returns <see langword="null" /> if no key is defined
/// for the given property.
/// ///
/// </summary>
/// <param name="property"> The property that the key is defined on. </param>
/// <returns> The key, or null if none is defined. </returns>
Expand Down
3 changes: 2 additions & 1 deletion src/EFCore/Metadata/Internal/EntityType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public EntityType(string name, Type type, Model model, bool owned, Configuration
/// </summary>
public virtual InternalEntityTypeBuilder Builder
{
[DebuggerStepThrough] get => _builder ?? throw new InvalidOperationException(CoreStrings.ObjectRemovedFromModel);
[DebuggerStepThrough]
get => _builder ?? throw new InvalidOperationException(CoreStrings.ObjectRemovedFromModel);
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion src/EFCore/Metadata/Internal/ForeignKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public ForeignKey(
/// </summary>
public virtual InternalForeignKeyBuilder Builder
{
[DebuggerStepThrough] get => _builder ?? throw new InvalidOperationException(CoreStrings.ObjectRemovedFromModel);
[DebuggerStepThrough]
get => _builder ?? throw new InvalidOperationException(CoreStrings.ObjectRemovedFromModel);
}

/// <summary>
Expand Down
27 changes: 18 additions & 9 deletions src/EFCore/Metadata/Internal/Index.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public Index(
/// </summary>
public virtual InternalIndexBuilder Builder
{
[DebuggerStepThrough] get => _builder ?? throw new InvalidOperationException(CoreStrings.ObjectRemovedFromModel);
[DebuggerStepThrough]
get => _builder ?? throw new InvalidOperationException(CoreStrings.ObjectRemovedFromModel);
}

/// <summary>
Expand Down Expand Up @@ -261,7 +262,8 @@ public virtual DebugView DebugView
/// </summary>
IReadOnlyList<IReadOnlyProperty> IReadOnlyIndex.Properties
{
[DebuggerStepThrough] get => Properties;
[DebuggerStepThrough]
get => Properties;
}

/// <summary>
Expand All @@ -272,7 +274,8 @@ IReadOnlyList<IReadOnlyProperty> IReadOnlyIndex.Properties
/// </summary>
IReadOnlyEntityType IReadOnlyIndex.DeclaringEntityType
{
[DebuggerStepThrough] get => DeclaringEntityType;
[DebuggerStepThrough]
get => DeclaringEntityType;
}

/// <summary>
Expand All @@ -283,7 +286,8 @@ IReadOnlyEntityType IReadOnlyIndex.DeclaringEntityType
/// </summary>
IReadOnlyList<IMutableProperty> IMutableIndex.Properties
{
[DebuggerStepThrough] get => Properties;
[DebuggerStepThrough]
get => Properties;
}

/// <summary>
Expand All @@ -294,7 +298,8 @@ IReadOnlyList<IMutableProperty> IMutableIndex.Properties
/// </summary>
IMutableEntityType IMutableIndex.DeclaringEntityType
{
[DebuggerStepThrough] get => DeclaringEntityType;
[DebuggerStepThrough]
get => DeclaringEntityType;
}

/// <summary>
Expand All @@ -305,7 +310,8 @@ IMutableEntityType IMutableIndex.DeclaringEntityType
/// </summary>
IConventionIndexBuilder IConventionIndex.Builder
{
[DebuggerStepThrough] get => Builder;
[DebuggerStepThrough]
get => Builder;
}

/// <summary>
Expand All @@ -316,7 +322,8 @@ IConventionIndexBuilder IConventionIndex.Builder
/// </summary>
IConventionAnnotatableBuilder IConventionAnnotatable.Builder
{
[DebuggerStepThrough] get => Builder;
[DebuggerStepThrough]
get => Builder;
}

/// <summary>
Expand All @@ -327,7 +334,8 @@ IConventionAnnotatableBuilder IConventionAnnotatable.Builder
/// </summary>
IReadOnlyList<IConventionProperty> IConventionIndex.Properties
{
[DebuggerStepThrough] get => Properties;
[DebuggerStepThrough]
get => Properties;
}

/// <summary>
Expand All @@ -350,7 +358,8 @@ IReadOnlyList<IProperty> IIndex.Properties
/// </summary>
IConventionEntityType IConventionIndex.DeclaringEntityType
{
[DebuggerStepThrough] get => DeclaringEntityType;
[DebuggerStepThrough]
get => DeclaringEntityType;
}

/// <summary>
Expand Down
9 changes: 4 additions & 5 deletions src/EFCore/Metadata/Internal/InternalEntityTypeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,11 +1015,10 @@ private bool CanAddServiceProperty(MemberInfo memberInfo, ConfigurationSource co
.All(
m => configurationSource.Overrides(m.GetConfigurationSource())
&& m.GetConfigurationSource() != ConfigurationSource.Explicit)
&& Metadata.FindServicePropertiesInHierarchy(propertyName)
.All(
m => (configurationSource.Overrides(m.GetConfigurationSource())
&& m.GetConfigurationSource() != ConfigurationSource.Explicit)
|| memberInfo.IsOverridenBy(m.GetIdentifyingMemberInfo()));
&& Metadata.FindServicePropertiesInHierarchy(propertyName).All(
m => (configurationSource.Overrides(m.GetConfigurationSource())
&& m.GetConfigurationSource() != ConfigurationSource.Explicit)
|| memberInfo.IsOverridenBy(m.GetIdentifyingMemberInfo()));
}

private static InternalServicePropertyBuilder? DetachServiceProperty(ServiceProperty? serviceProperty)
Expand Down
3 changes: 2 additions & 1 deletion src/EFCore/Metadata/Internal/InternalForeignKeyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4071,7 +4071,8 @@ private enum Resolution
/// <inheritdoc />
IConventionForeignKey IConventionForeignKeyBuilder.Metadata
{
[DebuggerStepThrough] get => Metadata;
[DebuggerStepThrough]
get => Metadata;
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ public virtual bool CanSetAutoInclude(bool? autoInclude, ConfigurationSource con

IConventionPropertyBase IConventionPropertyBaseBuilder.Metadata
{
[DebuggerStepThrough] get => Metadata;
[DebuggerStepThrough]
get => Metadata;
}

IConventionSkipNavigation IConventionSkipNavigationBuilder.Metadata
Expand Down
Loading

0 comments on commit c63d482

Please sign in to comment.