Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Query: Log query execution plan #16080

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ public override EntityFrameworkServicesBuilder TryAddCoreServices()
TryAdd<IRelationalValueBufferFactoryFactory, TypedRelationalValueBufferFactoryFactory>();
TryAdd<IDatabaseCreator>(p => p.GetService<IRelationalDatabaseCreator>());
TryAdd<IDbContextTransactionManager>(p => p.GetService<IRelationalConnection>());
TryAdd<IExpressionPrinter, RelationalExpressionPrinter>();
TryAdd<IQueryContextFactory, RelationalQueryContextFactory>();
TryAdd<ICompiledQueryCacheKeyGenerator, RelationalCompiledQueryCacheKeyGenerator>();
TryAdd<INamedConnectionStringResolver, NamedConnectionStringResolver>();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ private void Print(
ExpressionPrinter expressionPrinter)
{
if (value is IEnumerable enumerable
&& !(value is string))
&& !(value is string)
&& !(value is byte[]))
{
bool first = true;
foreach (var item in enumerable)
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/Diagnostics/CoreLoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private static string QueryIterationFailed(EventDefinitionBase definition, Event
/// <param name="queryExecutorExpression"> The query expression tree. </param>
public static void QueryExecutionPlanned(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics,
[NotNull] IExpressionPrinter expressionPrinter,
[NotNull] ExpressionPrinter expressionPrinter,
[NotNull] Expression queryExecutorExpression)
{
var definition = CoreResources.LogQueryExecutionPlanned(diagnostics);
Expand Down
8 changes: 4 additions & 4 deletions src/EFCore/Diagnostics/QueryExpressionEventData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public class QueryExpressionEventData : EventData
/// <param name="eventDefinition"> The event definition. </param>
/// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
/// <param name="queryExpression"> The <see cref="Expression" />. </param>
/// <param name="expressionPrinter"> An <see cref="IExpressionPrinter" /> that can be used to render the <see cref="Expression" />. </param>
/// <param name="expressionPrinter"> An <see cref="ExpressionPrinter" /> that can be used to render the <see cref="Expression" />. </param>
public QueryExpressionEventData(
[NotNull] EventDefinitionBase eventDefinition,
[NotNull] Func<EventDefinitionBase, EventData, string> messageGenerator,
[NotNull] Expression queryExpression,
[NotNull] IExpressionPrinter expressionPrinter)
[NotNull] ExpressionPrinter expressionPrinter)
: base(eventDefinition, messageGenerator)
{
Expression = queryExpression;
Expand All @@ -39,8 +39,8 @@ public QueryExpressionEventData(
public virtual Expression Expression { get; }

/// <summary>
/// An <see cref="IExpressionPrinter" /> that can be used to render the <see cref="Expression" />.
/// An <see cref="ExpressionPrinter" /> that can be used to render the <see cref="Expression" />.
/// </summary>
public virtual IExpressionPrinter ExpressionPrinter { get; }
public virtual ExpressionPrinter ExpressionPrinter { get; }
}
}
2 changes: 0 additions & 2 deletions src/EFCore/Infrastructure/EntityFrameworkServicesBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public static readonly IDictionary<Type, ServiceCharacteristics> CoreServices
{ typeof(IChangeDetector), new ServiceCharacteristics(ServiceLifetime.Scoped) },
{ typeof(IDbContextServices), new ServiceCharacteristics(ServiceLifetime.Scoped) },
{ typeof(IValueGeneratorSelector), new ServiceCharacteristics(ServiceLifetime.Scoped) },
{ typeof(IExpressionPrinter), new ServiceCharacteristics(ServiceLifetime.Scoped) },
{ typeof(IExecutionStrategyFactory), new ServiceCharacteristics(ServiceLifetime.Scoped) },
{ typeof(IAsyncQueryProvider), new ServiceCharacteristics(ServiceLifetime.Scoped) },
{ typeof(IQueryCompiler), new ServiceCharacteristics(ServiceLifetime.Scoped) },
Expand Down Expand Up @@ -234,7 +233,6 @@ public virtual EntityFrameworkServicesBuilder TryAddCoreServices()
TryAdd<ICompiledQueryCache, CompiledQueryCache>();
TryAdd<IAsyncQueryProvider, EntityQueryProvider>();
TryAdd<IQueryCompiler, QueryCompiler>();
TryAdd<IExpressionPrinter, ExpressionPrinter>();
TryAdd<ICompiledQueryCacheKeyGenerator, CompiledQueryCacheKeyGenerator>();
TryAdd<ISingletonOptionsInitializer, SingletonOptionsInitializer>();
TryAdd(typeof(IDiagnosticsLogger<>), typeof(DiagnosticsLogger<>));
Expand Down
Loading