src/Mimp.SeeSharper.Reflection/PropertyInfoExtensions.cs
/// <summary>
/// Return a compiled delegate to access the property.
/// </summary>
/// <typeparam name="TDelegate"></typeparam>
/// <param name="property"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentException">If the delegate hasn't one parameter for the instance.</exception>
/// <exception cref="InvalidOperationException">If the property type isn't castable to the delegate return type.</exception>
Return a compiled delegate to access the property.
Return a compiled delegate to access the property .
public static TDelegate GetInstanceAccessDelegate<TDelegate>(this PropertyInfo property) where TDelegate : Delegate
        {
            if (property is null)
                throw new ArgumentNullException(nameof(property));
            return (TDelegate)property.GetInstanceAccessDelegate(typeof(TDelegate));
        }
public static TDelegate GetInstanceAccessDelegate < TDelegate > ( this PropertyInfo property ) where TDelegate : Delegate { if ( property is null ) throw new ArgumentNullException ( nameof ( property ) ) ; return ( TDelegate ) property . GetInstanceAccessDelegate ( typeof ( TDelegate ) ) ; }
Return a compiled delegate to access the property.
Return a compiled delegate to access the property .
None
None
If the delegate hasn't one parameter for the instance.
If the delegate hasn ' t one parameter for the instance .
If the property type isn't castable to the delegate return type.
If the property type isn ' t castable to the delegate return type .
PropertyInfo
this
property
None
typeparam
None