# C1.Data.ClientCacheBase

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Data_ClientCacheBase" data-uid="C1.Data.ClientCacheBase" class="text-break">ClientCacheBase Class
</h1>
  <div class="markdown level0 summary"><p>Represents the client-side cache, the central hub of data access in the Studio for 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"><span class="xref">ClientCacheBase</span></div>
      <div class="level2"><a class="xref" href="C1.Data.Entities.EntityClientCache.html">EntityClientCache</a></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.html">C1.Data</a></h6>
  <h6><strong>Assembly</strong>: C1.Data.Entity.4.8.dll</h6>
  <h5 id="C1_Data_ClientCacheBase_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract class ClientCacheBase : IDisposable, INotifyPropertyChanged</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public MustInherit Class ClientCacheBase
    Implements IDisposable, INotifyPropertyChanged</code></pre>
  </div>
  <h5 id="C1_Data_ClientCacheBase_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>
Usually, a single instance of this class is created on application startup with an ObjectContext/DomainContext as a parameter
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.ClientScope.html">ClientScope</a> created by calling the <a class="xref" href="C1.Data.ClientCacheBase.CreateScope.html#C1_Data_ClientCacheBase_CreateScope">CreateScope()</a> method.
</p>
<p>
It is the base class for platform-specific implementations, such as 
C1.Data.Entities.EntityClientCache (Entity Framework), 
C1.Silverlight.Data.RiaServices.RiaClientCache (RIA Services).
</p>
</div>
  <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_ClientCacheBase_BulkChanges_System_Action_" data-uid="C1.Data.ClientCacheBase.BulkChanges(System.Action)">
          <a class="xref" href="C1.Data.ClientCacheBase.BulkChanges.html#C1_Data_ClientCacheBase_BulkChanges_System_Action_">BulkChanges(Action)</a>
        </td>
        <td class="markdown level1 summary"><p>Used to group massive changes to entities and to allow manual explicit changes of entity states.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_CleanupCache" data-uid="C1.Data.ClientCacheBase.CleanupCache">
          <a class="xref" href="C1.Data.ClientCacheBase.CleanupCache.html#C1_Data_ClientCacheBase_CleanupCache">CleanupCache()</a>
        </td>
        <td class="markdown level1 summary"><p>Forces unused memory to be released, unused entities to be detached from the context.
It is usually done automatically, so programmers rarely need to call this method in code.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_Clear" data-uid="C1.Data.ClientCacheBase.Clear">
          <a class="xref" href="C1.Data.ClientCacheBase.Clear.html#C1_Data_ClientCacheBase_Clear">Clear()</a>
        </td>
        <td class="markdown level1 summary"><p>Clears client-side cache entirely. Call this method if you want to make sure that following queries will fetch fresh data
from the server.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_CreateScope" data-uid="C1.Data.ClientCacheBase.CreateScope">
          <a class="xref" href="C1.Data.ClientCacheBase.CreateScope.html#C1_Data_ClientCacheBase_CreateScope">CreateScope()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a <a class="xref" href="C1.Data.ClientScope.html">ClientScope</a> that defines a scope of data access.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_CreateTransaction" data-uid="C1.Data.ClientCacheBase.CreateTransaction">
          <a class="xref" href="C1.Data.ClientCacheBase.CreateTransaction.html#C1_Data_ClientCacheBase_CreateTransaction">CreateTransaction()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a <a class="xref" href="C1.Data.Transactions.ClientTransaction.html">ClientTransaction</a> that allows you to easily cancel changes
made in transaction scope.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_Refresh" data-uid="C1.Data.ClientCacheBase.Refresh">
          <a class="xref" href="C1.Data.ClientCacheBase.Refresh.html#C1_Data_ClientCacheBase_Refresh">Refresh()</a>
        </td>
        <td class="markdown level1 summary"><p>Refreshes data in all C1DataSource controls connected to this ClientCacheBase.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_RejectChanges" data-uid="C1.Data.ClientCacheBase.RejectChanges">
          <a class="xref" href="C1.Data.ClientCacheBase.RejectChanges.html#C1_Data_ClientCacheBase_RejectChanges">RejectChanges()</a>
        </td>
        <td class="markdown level1 summary"><p>Reverts all pending changes for this <a class="xref" href="C1.Data.ClientCacheBase.html">ClientCacheBase</a>.
It is recommended to call this method instead of System.Data.Objects.ObjectContext.Refresh(System.Data.Objects.RefreshMode, object).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_ClientCacheBase_SaveChanges" data-uid="C1.Data.ClientCacheBase.SaveChanges">
          <a class="xref" href="C1.Data.ClientCacheBase.SaveChanges.html#C1_Data_ClientCacheBase_SaveChanges">SaveChanges()</a>
        </td>
        <td class="markdown level1 summary"><p>Persists all changes to the server. It is recommended to call this method instead of
System.Data.Objects.ObjectContext.SaveChanges().</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
