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

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

ArgumentException with message like "Field '{0}' is not defined for type '{1}'"
static private FieldNotDefinedForType ( object p0, object p1 ) : Exception
p0 object
p1 object
Результат System.Exception
        internal static Exception FieldNotDefinedForType(object p0, object p1)
        {
            return new ArgumentException(Strings.FieldNotDefinedForType(p0, p1));
        }
        /// <summary>

Usage Example

Пример #1
0
        public static MemberExpression Field(Expression expression, Type type, string fieldName)
        {
            ContractUtils.RequiresNotNull(type, nameof(type));

            // bind to public names first
            FieldInfo fi = type.GetField(fieldName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy)
                           ?? type.GetField(fieldName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy);

            if (fi == null)
            {
                throw Error.FieldNotDefinedForType(fieldName, type);
            }
            return(Expression.Field(expression, fi));
        }
All Usage Examples Of System.Linq.Expressions.Error::FieldNotDefinedForType
Error