System.Linq.Expressions.Error.MustRewriteChildToSameType C# (CSharp) Метод

MustRewriteChildToSameType() статический приватный Метод

InvalidOperationException with message like "Rewriting child expression from type '{0}' to type '{1}' is not allowed, because it would change the meaning of the operation. If this is intentional, override '{2}' and change it to allow this rewrite."
static private MustRewriteChildToSameType ( object p0, object p1, object p2 ) : Exception
p0 object
p1 object
p2 object
Результат System.Exception
        internal static Exception MustRewriteChildToSameType(object p0, object p1, object p2)
        {
            return new InvalidOperationException(Strings.MustRewriteChildToSameType(p0, p1, p2));
        }
        /// <summary>

Usage Example

 private static void ValidateChildType(Type before, Type after, string methodName)
 {
     if (before.IsValueType)
     {
         if (TypeUtils.AreEquivalent(before, after))
         {
             return;
         }
     }
     else if (!after.IsValueType)
     {
         return;
     }
     throw Error.MustRewriteChildToSameType(before, after, methodName);
 }
All Usage Examples Of System.Linq.Expressions.Error::MustRewriteChildToSameType
Error