public static void Visit <TContainer, TVisitor>(ref TContainer container, TVisitor visitor, ref ChangeTracker changeTracker) where TVisitor : IPropertyVisitor { if (RuntimeTypeInfoCache <TContainer> .IsAbstractOrInterface()) { PropertyBagResolver.Resolve(container.GetType())?.Accept(container, visitor, ref changeTracker); } else { PropertyBagResolver.Resolve <TContainer>()?.Accept(ref container, visitor, ref changeTracker); } }
public static void Transfer <TDestination, TSource>(ref TDestination destination, ref TSource source, ref ChangeTracker changeTracker) { if (RuntimeTypeInfoCache <TSource> .IsAbstractOrInterface()) { var propertyBag = PropertyBagResolver.Resolve(source.GetType()); var action = new TransferAbstractType <TDestination> { Destination = destination, SourceContainer = (object)source }; propertyBag.Cast(action); destination = action.Destination; } else { Visit(ref destination, new TransferVisitor <TSource>(source), ref changeTracker); } }