Пример #1
0
        private static bool TryCustomCopy <T>(T source, T target, MemberSettings settings, out T copy)
        {
            if (settings.TryGetCopyer(source.GetType(), out var copyer))
            {
                copy = (T)copyer.Copy(source, target);
                return(true);
            }

            copy = default(T);
            return(false);
        }
Пример #2
0
            private static TypeErrors CreateErrors(Type type, MemberSettings settings, MemberPath path)
            {
                if (settings.IsImmutable(type) || settings.TryGetCopyer(type, out var temp))
                {
                    return(null);
                }

                var errors = VerifyCore(settings, type)
                             .VerifyRecursive(type, settings, path, GetNodeErrors)
                             .Finnish();

                return(errors);
            }