Ejemplo n.º 1
0
        /// <summary>
        /// Determine if the collection is "really" dirty, by checking dirtiness
        /// of the collection elements, if necessary
        /// </summary>
        private void Dirty(IPersistentCollection collection)
        {
            // if the collection is initialized and it was previously persistent
            // initialize the dirty flag
            bool forceDirty = collection.WasInitialized && !collection.IsDirty && LoadedPersister != null &&
                              LoadedPersister.IsMutable &&
                              (collection.IsDirectlyAccessible || LoadedPersister.ElementType.IsMutable) &&
                              !collection.EqualsSnapshot(LoadedPersister);

            if (forceDirty)
            {
                collection.Dirty();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determine if the collection is "really" dirty, by checking dirtiness
        /// of the collection elements, if necessary
        /// </summary>
        private async Task DirtyAsync(IPersistentCollection collection, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            // if the collection is initialized and it was previously persistent
            // initialize the dirty flag
            bool forceDirty = collection.WasInitialized && !collection.IsDirty && LoadedPersister != null &&
                              LoadedPersister.IsMutable &&
                              (collection.IsDirectlyAccessible || LoadedPersister.ElementType.IsMutable) &&
                              !await(collection.EqualsSnapshotAsync(LoadedPersister, cancellationToken)).ConfigureAwait(false);

            if (forceDirty)
            {
                collection.Dirty();
            }
        }
Ejemplo n.º 3
0
		/// <summary> 
		/// Determine if the collection is "really" dirty, by checking dirtiness
		/// of the collection elements, if necessary
		/// </summary>
		private void Dirty(IPersistentCollection collection)
		{
			// if the collection is initialized and it was previously persistent
			// initialize the dirty flag
			bool forceDirty = collection.WasInitialized && !collection.IsDirty && LoadedPersister != null
			                  && LoadedPersister.IsMutable
			                  && (collection.IsDirectlyAccessible || LoadedPersister.ElementType.IsMutable)
			                  && !collection.EqualsSnapshot(LoadedPersister);

			if (forceDirty)
			{
				collection.Dirty();
			}
		}