Пример #1
0
 private bool HasDirtyCollections(FlushEntityEvent @event, IEntityPersister persister, Status status)
 {
     if (IsCollectionDirtyCheckNecessary(persister, status))
     {
         DirtyCollectionSearchVisitor visitor = new DirtyCollectionSearchVisitor(@event.Session, persister.PropertyVersionability);
         visitor.ProcessEntityPropertyValues(@event.PropertyValues, persister.PropertyTypes);
         bool hasDirtyCollections = visitor.WasDirtyCollectionFound;
         @event.HasDirtyCollection = hasDirtyCollections;
         return(hasDirtyCollections);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
 private async Task <bool> HasDirtyCollectionsAsync(FlushEntityEvent @event, IEntityPersister persister, Status status, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     if (IsCollectionDirtyCheckNecessary(persister, status))
     {
         DirtyCollectionSearchVisitor visitor = new DirtyCollectionSearchVisitor(@event.Session, persister.PropertyVersionability);
         await(visitor.ProcessEntityPropertyValuesAsync(@event.PropertyValues, persister.PropertyTypes, cancellationToken)).ConfigureAwait(false);
         bool hasDirtyCollections = visitor.WasDirtyCollectionFound;
         @event.HasDirtyCollection = hasDirtyCollections;
         return(hasDirtyCollections);
     }
     else
     {
         return(false);
     }
 }