protected virtual async Task <bool> VisitCollectionsBeforeSaveAsync(object entity, object id, object[] values, IType[] types, IEventSource source, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); WrapVisitor visitor = new WrapVisitor(source); // substitutes into values by side-effect await(visitor.ProcessEntityPropertyValuesAsync(values, types, cancellationToken)).ConfigureAwait(false); return(visitor.SubstitutionRequired); }
private async Task <bool> WrapCollectionsAsync(IEventSource session, IEntityPersister persister, IType[] types, object[] values, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (persister.HasCollections) { // wrap up any new collections directly referenced by the object // or its components // NOTE: we need to do the wrap here even if its not "dirty", // because collections need wrapping but changes to _them_ // don't dirty the container. Also, for versioned data, we // need to wrap before calling searchForDirtyCollections WrapVisitor visitor = new WrapVisitor(session); // substitutes into values by side-effect await(visitor.ProcessEntityPropertyValuesAsync(values, types, cancellationToken)).ConfigureAwait(false); return(visitor.SubstitutionRequired); } else { return(false); } }