IMetadataObject DeepClone(IMetadataObject node, ProcessArgument processArgument, ChildChangesGetter childChangesGetter, Func <IMetadataObject, bool> mustForceVisit) { if (node == null) { throw new ArgumentNullException(nameof(node)); } if (processArgument == null) { throw new ArgumentNullException(nameof(processArgument)); } if (childChangesGetter == null) { throw new ArgumentNullException(nameof(childChangesGetter)); } if (mustForceVisit == null) { throw new ArgumentNullException(nameof(mustForceVisit)); } ILazyChildren ProcessChildren(ChildPropertyInfo childProperty, ILazyChildren children, IMetadataObject @new, IModelDataAccessor childDataAccessor) { var childChanges = childChangesGetter.Invoke(node, childProperty); return(children.Clone( forceVisit: mustForceVisit(children.Parent), update: n => DeepClone(n, processArgument, childChangesGetter, mustForceVisit), added: childChanges.Additions, deleted: childChanges.Deletions)); } return(node.DataAccessor.ConstructorParameterBinding.Cloner(node, processArgument, ProcessChildren)); }
/// <inheritdoc /> public IObjectRepository DeepClone(IObjectRepository instance, ProcessArgument processArgument, ChildChangesGetter childChangesGetter, Func <IMetadataObject, bool> mustForceVisit) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } return((IObjectRepository)DeepClone((IMetadataObject)instance, processArgument, childChangesGetter, mustForceVisit)); }