Beispiel #1
0
            internal static InvalidOperationException CreateCannotCreateInstanceException(
                object sourceValue,
                MemberSettings settings,
                Exception exception)
            {
                var cannotCopyError = new CannotCreateInstanceError(sourceValue);
                var typeErrors      = new TypeErrors(sourceValue.GetType(), new Error[] { cannotCopyError });
                var message         = typeErrors.GetErrorText(settings, typeof(Copy).Name, settings.CopyMethodName());

                return(new InvalidOperationException(message, exception));
            }
Beispiel #2
0
 internal static InvalidOperationException CreateCannotCreateInstanceException(
     object sourceValue,
     MemberSettings settings,
     Exception exception)
 {
     var cannotCopyError = new CannotCreateInstanceError(sourceValue);
     var typeErrors = new TypeErrors(sourceValue.GetType(), new Error[] { cannotCopyError });
     var message = typeErrors.GetErrorText(settings, typeof(Copy).Name, settings.CopyMethodName());
     return new InvalidOperationException(message, exception);
 }