Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Mapping / EntityViewContainer.cs
1 //---------------------------------------------------------------------
2 // <copyright file="EntityViewContainer.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner       [....]
7 // @backupOwner [....]
8 //---------------------------------------------------------------------
9
10 using System;
11 using System.Collections;
12 using System.Collections.Generic;
13 using System.Data.Common.Utils;
14 using System.Text;
15
16
17 namespace System.Data.Mapping
18 {
19     /// <summary>
20     /// Base class for the type created at design time to store the generated views.
21     /// </summary>
22     public abstract class EntityViewContainer
23     {
24         #region Constructors
25         protected EntityViewContainer()
26         {
27         }
28         #endregion
29
30         #region fields
31         private string m_storedHashOverMappingClosure; // Hash value over the whole Metadata and Mapping closure
32         private string m_storedhashOverAllExtentViews; // Hash value over all the extent views
33         private string m_storededmEntityContainerName; // C side entity container name
34         private string m_storedStoreEntityContainerName; // S side entity container name
35         private int _viewCount;
36         #endregion
37
38         #region properties
39         /// <summary>
40         /// Returns the cached dictionary of (ExtentName,EsqlView)
41         /// </summary>
42         internal IEnumerable<KeyValuePair<string, string>> ExtentViews
43         {
44             get
45             {
46                 for (int i = 0; i < ViewCount; i++)
47                 {
48                     yield return GetViewAt(i);
49                 }
50             }
51         }
52
53         protected abstract System.Collections.Generic.KeyValuePair<string, string> GetViewAt(int index);
54
55         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")]
56         public string EdmEntityContainerName
57         {
58             get
59             {
60                 return this.m_storededmEntityContainerName;
61             }
62             set
63             {
64                 this.m_storededmEntityContainerName = value;
65             }
66         }
67         public string StoreEntityContainerName
68         {
69             get
70             {
71                 return this.m_storedStoreEntityContainerName;
72             }
73             set
74             {
75                 this.m_storedStoreEntityContainerName = value;
76             }
77         }
78         public string HashOverMappingClosure
79         {
80             get
81             {
82                 return this.m_storedHashOverMappingClosure;
83             }
84             set
85             {
86                 this.m_storedHashOverMappingClosure = value;
87             }
88         }
89         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "OverAll")]
90         public string HashOverAllExtentViews
91         {
92             get
93             {
94                 return this.m_storedhashOverAllExtentViews;
95             }
96             set
97             {
98                 this.m_storedhashOverAllExtentViews = value;
99             }
100         }
101
102         public int ViewCount
103         {
104             get { return _viewCount; }
105             protected set { _viewCount = value; }
106         }
107         #endregion
108     }
109 }