Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Common / QueryCache / QueryCacheEntry.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="QueryCacheEntry.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner  [....]
7 // @backupOwner [....]
8 //------------------------------------------------------------------------------
9
10 namespace System.Data.Common.QueryCache
11 {
12     using System;
13     using System.Collections.Generic;
14     using System.Text;
15     using System.Data.Common;
16     using System.Diagnostics;
17
18     /// <summary> 
19     /// Represents the abstract base class for all cache entry values in the query cache 
20     /// </summary> 
21     internal class QueryCacheEntry
22     {
23         #region Fields
24         /// <summary>
25         /// querycachekey for this entry
26         /// </summary>
27         readonly private QueryCacheKey _queryCacheKey;
28
29         /// <summary> 
30         /// strong reference to the target object 
31         /// </summary> 
32         readonly protected object _target;
33         #endregion
34
35         #region Constructors
36         /// <summary> 
37         /// cache entry constructor 
38         /// </summary> 
39         /// <param name="queryCacheKey"></param> 
40         /// <param name="target"></param> 
41         internal QueryCacheEntry(QueryCacheKey queryCacheKey, object target)
42         {
43             _queryCacheKey = queryCacheKey;
44             _target = target;
45         }
46         #endregion
47
48         #region Methods and Properties
49         /// <summary> 
50         /// The payload of this cache entry.
51         /// </summary> 
52         internal virtual object GetTarget()
53         {
54             return _target;
55         }
56
57         /// <summary>
58         /// Returns the query cache key
59         /// </summary>
60         internal QueryCacheKey QueryCacheKey
61         {
62             get { return _queryCacheKey; }
63         }
64         #endregion
65     }
66 }