src/Mimp.SeeSharper.Reflection/FieldInfoExtensions.cs
/// <summary>
/// Return a compiled function to access the field.
/// </summary>
/// <typeparam name="TInstance"></typeparam>
/// <typeparam name="TField"></typeparam>
/// <param name="field"></param>
/// <returns></returns>
Return a compiled function to access the field.
Return a compiled function to access the field .
public static Func<TInstance, TField> GetInstanceAccessFunc<TInstance, TField>(this FieldInfo field)
            where TInstance : notnull
        {
            if (field is null)
                throw new ArgumentNullException(nameof(field));
            return field.GetInstanceAccessDelegate<Func<TInstance, TField>>();
        }
public static Func < TInstance , TField > GetInstanceAccessFunc < TInstance , TField > ( this FieldInfo field ) where TInstance : notnull { if ( field is null ) throw new ArgumentNullException ( nameof ( field ) ) ; return field . GetInstanceAccessDelegate < Func < TInstance , TField > > ( ) ; }
Return a compiled function to access the field.
Return a compiled function to access the field .
None
FieldInfo
this
field
None
typeparam
None
typeparam
None