src/Mimp.SeeSharper.Reflection/TypeExtensions.Field.cs
/// <summary>
/// Return the public instance field.
/// </summary>
/// <param name="type"></param>
/// <param name="name"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="InvalidOperationException">If no or more than one field exsists.</exception>
Return the public instance field.
Return the public instance field .
public static FieldInfo GetInstanceField(this Type type, string name)
        {
            if (type is null)
                throw new ArgumentNullException(nameof(type));
            if (name is null)
                throw new ArgumentNullException(nameof(name));
            return type.GetField(name, true, false, true);
        }
public static FieldInfo GetInstanceField ( this Type type , string name ) { if ( type is null ) throw new ArgumentNullException ( nameof ( type ) ) ; if ( name is null ) throw new ArgumentNullException ( nameof ( name ) ) ; return type . GetField ( name , true , false , true ) ; }
Return the public instance field.
Return the public instance field .
None
None
If no or more than one field exsists.
If no or more than one field exsists .
Type
this
<not_specific>
name
string
None
type
<not_specific>
None