# C1.Data.Entities.EntityClientCache

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Data_Entities_EntityClientCache" data-uid="C1.Data.Entities.EntityClientCache" class="text-break">EntityClientCache Class
</h1>
  <div class="markdown level0 summary"><p>Represents a client-side cache specific to Entity Framework.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="C1.Data.ClientCacheBase.html">ClientCacheBase</a></div>
    <div class="level2"><span class="xref">EntityClientCache</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Data.Entities.html">C1.Data.Entities</a></h6>
  <h6><strong>Assembly</strong>: C1.Data.Entity.4.8.dll</h6>
  <h5 id="C1_Data_Entities_EntityClientCache_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class EntityClientCache : ClientCacheBase, IDisposable, INotifyPropertyChanged</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class EntityClientCache
    Inherits ClientCacheBase
    Implements IDisposable, INotifyPropertyChanged</code></pre>
  </div>
  <h5 id="C1_Data_Entities_EntityClientCache_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>Usually, a single instance of this class is created on application startup
and exists during the entire application lifetime,
while each form, window, or user control works with data using a <a class="xref" href="C1.Data.Entities.EntityClientScope.html">EntityClientScope</a> created by calling the <a class="xref" href="C1.Data.Entities.EntityClientCache.CreateScope.html#C1_Data_Entities_EntityClientCache_CreateScope">CreateScope()</a> method.</p>
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache__ctor_System_Data_Entity_Core_Objects_ObjectContext_" data-uid="C1.Data.Entities.EntityClientCache.#ctor(System.Data.Entity.Core.Objects.ObjectContext)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.-ctor.html#C1_Data_Entities_EntityClientCache__ctor_System_Data_Entity_Core_Objects_ObjectContext_">EntityClientCache(ObjectContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Data.Entities.EntityClientCache.html">EntityClientCache</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache__ctor_System_Data_Entity_DbContext_" data-uid="C1.Data.Entities.EntityClientCache.#ctor(System.Data.Entity.DbContext)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.-ctor.html#C1_Data_Entities_EntityClientCache__ctor_System_Data_Entity_DbContext_">EntityClientCache(DbContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Data.Entities.EntityClientCache.html">EntityClientCache</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_DbContext" data-uid="C1.Data.Entities.EntityClientCache.DbContext">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.DbContext.html#C1_Data_Entities_EntityClientCache_DbContext">DbContext</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_ObjectContext" data-uid="C1.Data.Entities.EntityClientCache.ObjectContext">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.ObjectContext.html#C1_Data_Entities_EntityClientCache_ObjectContext">ObjectContext</a>
        </td>
        <td class="markdown level1 summary"><p>The <a class="xref" href="C1.Data.Entities.EntityClientCache.ObjectContext.html#C1_Data_Entities_EntityClientCache_ObjectContext">ObjectContext</a> through which <a class="xref" href="C1.Data.Entities.EntityClientCache.html">EntityClientCache</a> accesses the data.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_AcceptChanges" data-uid="C1.Data.Entities.EntityClientCache.AcceptChanges">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.AcceptChanges.html#C1_Data_Entities_EntityClientCache_AcceptChanges">AcceptChanges()</a>
        </td>
        <td class="markdown level1 summary"><p>Accepts all changes made to entities in the <a class="xref" href="C1.Data.Entities.EntityClientCache.ObjectContext.html#C1_Data_Entities_EntityClientCache_ObjectContext">ObjectContext</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_CreateScope" data-uid="C1.Data.Entities.EntityClientCache.CreateScope">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.CreateScope.html#C1_Data_Entities_EntityClientCache_CreateScope">CreateScope()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.Data.Entities.EntityClientScope.html">Entity Framework-specific client scope</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_GetDefault_System_Type_" data-uid="C1.Data.Entities.EntityClientCache.GetDefault(System.Type)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.GetDefault.html#C1_Data_Entities_EntityClientCache_GetDefault_System_Type_">GetDefault(Type)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the default <a class="xref" href="C1.Data.Entities.EntityClientCache.html">EntityClientCache</a> for a given <code class="paramref">contextType</code>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_Core_Objects_ObjectContext_" data-uid="C1.Data.Entities.EntityClientCache.RegisterContext(System.Data.Entity.Core.Objects.ObjectContext)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.RegisterContext.html#C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_Core_Objects_ObjectContext_">RegisterContext(ObjectContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Registers an <a class="xref" href="C1.Data.Entities.EntityClientCache.ObjectContext.html#C1_Data_Entities_EntityClientCache_ObjectContext">ObjectContext</a> as a default for C1DataSource controls.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_Core_Objects_ObjectContext_System_Type_" data-uid="C1.Data.Entities.EntityClientCache.RegisterContext(System.Data.Entity.Core.Objects.ObjectContext,System.Type)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.RegisterContext.html#C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_Core_Objects_ObjectContext_System_Type_">RegisterContext(ObjectContext, Type)</a>
        </td>
        <td class="markdown level1 summary"><p>Registers an <a class="xref" href="C1.Data.Entities.EntityClientCache.ObjectContext.html#C1_Data_Entities_EntityClientCache_ObjectContext">ObjectContext</a> as a default for C1DataSource controls for a given <code class="paramref">contextType</code>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_DbContext_" data-uid="C1.Data.Entities.EntityClientCache.RegisterContext(System.Data.Entity.DbContext)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.RegisterContext.html#C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_DbContext_">RegisterContext(DbContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Registers an <a class="xref" href="C1.Data.Entities.EntityClientCache.DbContext.html#C1_Data_Entities_EntityClientCache_DbContext">DbContext</a> as a default for C1DataSource controls.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_DbContext_System_Type_" data-uid="C1.Data.Entities.EntityClientCache.RegisterContext(System.Data.Entity.DbContext,System.Type)">
          <a class="xref" href="C1.Data.Entities.EntityClientCache.RegisterContext.html#C1_Data_Entities_EntityClientCache_RegisterContext_System_Data_Entity_DbContext_System_Type_">RegisterContext(DbContext, Type)</a>
        </td>
        <td class="markdown level1 summary"><p>Registers an <a class="xref" href="C1.Data.Entities.EntityClientCache.DbContext.html#C1_Data_Entities_EntityClientCache_DbContext">DbContext</a> as a default for C1DataSource controls for a given <code class="paramref">contextType</code>.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
