This event is fired after changes has happened to the C1 CMS data store. This may be atomic actions or a larger change to the underlying data store. The StoreEventArgs class describe the change in broad terms, including a flag indicating is detailed data event have been raised or not. You can use this event as a simple way to react to data changes (like clearing a cache) or you can mix this with atomic data events (add, delete, update) to make a build a more advanced cache. You should listen to this event in order to support scale out across multiple servers, since this event is meant to be signaled when changes happen on another server. In such situations detailed data events will not fire on other machines.

Namespace: Composite.Data
Assembly: Composite (in Composite.dll) Version: 6.1.6325.31818

Syntax

C#
public static event StoreEventHandler OnStoreChanged
Visual Basic
Public Shared Event OnStoreChanged As StoreEventHandler
Visual C++
public:
static  event StoreEventHandler^ OnStoreChanged {
	void add (StoreEventHandler^ value);
	void remove (StoreEventHandler^ value);
}

Examples

CopyC#
void MyMethod()
{
   DataEvents<IMyDataType>.OnStoreChanged+= new StoreEventHandler(DataEvents_OnStoreChanged);

   using (DataConnection connection = new DataConnection())
   {
      IMyDataType myDataType = 
         (from item in connection.get<IMyDataType>()
          where item.Id == 1
          select item).First();

      connection.Delete<IMyDataType>(myDataType); // This will fire the event!
   }
}


void DataEvents_OnStoreChanged(object sender, StoreEventArgs storeEventArgs)
{        
}

See Also