Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Dec 10, 2019
1 parent cbea715 commit c69926a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Diagnostics;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Utilities;

Expand All @@ -21,7 +22,7 @@ public static class CosmosPropertyExtensions
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static bool IsOrdinalKeyProperty(this IProperty property)
public static bool IsOrdinalKeyProperty([NotNull] this IProperty property)
{
Check.DebugAssert(property.DeclaringEntityType.IsOwned(), $"Expected {property.DeclaringEntityType.DisplayName()} to be owned.");
Check.DebugAssert(property.GetJsonPropertyName().Length == 0, $"Expected {property.Name} to be non-persisted.");
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Cosmos/Update/Internal/DocumentSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public virtual JObject CreateDocument([NotNull] IUpdateEntry entry, int? ordinal
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual JObject UpdateDocument([NotNull] JObject document, IUpdateEntry entry)
public virtual JObject UpdateDocument([NotNull] JObject document, [NotNull] IUpdateEntry entry)
=> UpdateDocument(document, entry, null);

/// <summary>
Expand All @@ -148,7 +148,7 @@ public virtual JObject UpdateDocument([NotNull] JObject document, IUpdateEntry e
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual JObject UpdateDocument([NotNull] JObject document, IUpdateEntry entry, int? ordinal)
public virtual JObject UpdateDocument([NotNull] JObject document, [NotNull] IUpdateEntry entry, int? ordinal)
{
var anyPropertyUpdated = false;
var stateManager = ((InternalEntityEntry)entry).StateManager;
Expand Down
15 changes: 7 additions & 8 deletions src/EFCore/Diagnostics/CoreLoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -910,20 +910,19 @@ public static void RedundantAddServicesCallWarning(
{
var definition = CoreResources.LogRedundantAddServicesCall(diagnostics);

var warningBehavior = definition.GetLogBehavior(diagnostics);
if (warningBehavior != WarningBehavior.Ignore)
if (diagnostics.ShouldLog(definition))
{
definition.Log(diagnostics, warningBehavior);
definition.Log(diagnostics);
}

if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name))
if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
{
diagnostics.DiagnosticSource.Write(
definition.EventId.Name,
new ServiceProviderEventData(
var eventData = new ServiceProviderEventData(
definition,
(d, p) => ((EventDefinition)d).GenerateMessage(),
serviceProvider));
serviceProvider);

diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled);
}
}

Expand Down

0 comments on commit c69926a

Please sign in to comment.