'Declaration Public Sub BulkChanges( _ ByVal makeChanges As Action _ )
public void BulkChanges( Action makeChanges )
Parameters
- makeChanges
- A delegate that makes changes in entities.
'Declaration Public Sub BulkChanges( _ ByVal makeChanges As Action _ )
public void BulkChanges( Action makeChanges )
Internal state of the client-side cache and all existing client views based on the cache are kept unchanged, aren't updated while the given makeChanges is executed. After the delegate completes its execution (having modified multiple entities), the client-side cache internal state is restored and client views are updated (maintained) to reflect the changes made in entities during the delegate's execution.
There are two main scenarios where you should consider calling this method:
var scope = clientCache.CreateScope(); clientCache.BulkChanges(delegate { foreach(var detail in scope.GetItems<Order_Details>) detail.Discount *= 2; });