forked from dotnet/efcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryContext.cs
More file actions
40 lines (31 loc) · 1.25 KB
/
Copy pathQueryContext.cs
File metadata and controls
40 lines (31 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Open Technologies, Inc. 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.Generic;
using System.Threading;
using JetBrains.Annotations;
using Microsoft.Data.Entity.Utilities;
using Microsoft.Framework.Logging;
namespace Microsoft.Data.Entity.Query
{
public class QueryContext
{
private IDictionary<string, object> _parameterValues;
public QueryContext(
[NotNull] ILogger logger,
[NotNull] IQueryBuffer queryBuffer)
{
Check.NotNull(logger, nameof(logger));
Check.NotNull(queryBuffer, nameof(queryBuffer));
Logger = logger;
QueryBuffer = queryBuffer;
}
// TODO: Move this to compilation context
public virtual ILogger Logger { get; }
public virtual IQueryBuffer QueryBuffer { get; }
public virtual CancellationToken CancellationToken { get; set; }
public virtual IDictionary<string, object> ParameterValues
=> _parameterValues ?? (_parameterValues = new Dictionary<string, object>());
public virtual Type ContextType { get; [param: NotNull] set; }
}
}