fasterflect by Buu Nguyen, Morten Mertner

<PackageReference Include="fasterflect" Version="2.1.3" />

 PropertyExtensions

public static class PropertyExtensions
Extension methods for locating and accessing properties.
public static MethodInvoker DelegateForGetIndexer(this Type type, Type[] parameterTypes)

Creates a delegate which can get the value of an indexer.

public static MethodInvoker DelegateForGetIndexer(this Type type, Flags bindingFlags, Type[] parameterTypes)

Creates a delegate which can get the value of an indexer matching bindingFlags.

public static MemberGetter DelegateForGetPropertyValue(this Type type, string name)

Creates a delegate which can get the value of the property specified by on the given .

public static MemberGetter DelegateForGetPropertyValue(this Type type, string name, Flags bindingFlags)

Creates a delegate which can get the value of the property specified by matching on the given .

public static MethodInvoker DelegateForSetIndexer(this Type type, Type[] parameterTypes)

Creates a delegate which can set an indexer

public static MethodInvoker DelegateForSetIndexer(this Type type, Flags bindingFlags, Type[] parameterTypes)

Creates a delegate which can set an indexer matching bindingFlags.

public static MemberSetter DelegateForSetPropertyValue(this Type type, string name)

Creates a delegate which can set the value of the property specified by on the given .

public static MemberSetter DelegateForSetPropertyValue(this Type type, string name, Flags bindingFlags)

Creates a delegate which can set the value of the property specified by matching on the given .

public static object GetIndexer(this object obj, object[] parameters)

Gets the value of the indexer of the given obj

public static object GetIndexer(this object obj, Type[] parameterTypes, object[] parameters)

Gets the value of the indexer of the given obj

public static object GetIndexer(this object obj, Flags bindingFlags, object[] parameters)

Gets the value of the indexer matching bindingFlags of the given obj

public static object GetIndexer(this object obj, Type[] parameterTypes, Flags bindingFlags, object[] parameters)

Gets the value of the indexer matching bindingFlags of the given obj

public static object GetPropertyValue(this object obj, string name)

Gets the value of the property specified by on the given .

public static object GetPropertyValue(this object obj, string name, Flags bindingFlags)

Gets the value of the property specified by matching on the given .

public static object GetPropertyValue(this object obj, Expression<Func<object>> memberExpression)

Gets the value of the property specified by on the given .

public static IList<PropertyInfo> Properties(this Type type, string[] names)

Gets all public and non-public instance properties on the given type, including properties defined on base types. The result can optionally be filtered by specifying a list of property names to include using the names parameter.

public static IList<PropertyInfo> Properties(this Type type, Flags bindingFlags, string[] names)

Gets all properties on the given type that match the specified bindingFlags, including properties defined on base types.

public static PropertyInfo Property(this Type type, string name)

Gets the property identified by name on the given type. This method searches for public and non-public instance properties on both the type itself and all parent classes.

public static PropertyInfo Property(this Type type, string name, Flags bindingFlags)

Gets the property identified by name on the given type. Use the bindingFlags parameter to define the scope of the search.

public static object SetIndexer(this object obj, object[] parameters)

Sets the value of the indexer of the given obj

public static object SetIndexer(this object obj, Type[] parameterTypes, object[] parameters)

Sets the value of the indexer of the given obj

public static object SetIndexer(this object obj, Flags bindingFlags, object[] parameters)

Sets the value of the indexer matching bindingFlags of the given obj

public static object SetIndexer(this object obj, Type[] parameterTypes, Flags bindingFlags, object[] parameters)

Sets the value of the indexer matching bindingFlags of the given obj

public static object SetPropertyValue(this object obj, string name, object value)

Sets the property specified by on the given to the specified .

public static object SetPropertyValue(this object obj, string name, object value, Flags bindingFlags)

Sets the property specified by matching on the given to the specified .

public static object SetPropertyValue(this object obj, Expression<Func<object>> memberExpression, object value)

Sets the property specified by on the given to the specified .

public static object TryGetPropertyValue(this object obj, string name)

Gets the first (public or non-public) instance property with the given name on the given obj object. Returns the value of the property if a match was found and null otherwise.

public static object TryGetPropertyValue(this object obj, string name, Flags bindingFlags)

Gets the first property with the given name on the given obj object. Returns the value of the property if a match was found and null otherwise. Use the bindingFlags parameter to limit the scope of the search.

public static bool TrySetPropertyValue(this object obj, string name, object value)

Sets the first (public or non-public) instance property with the given name on the given obj object to the supplied value. Returns true if a value was assigned to a property and false otherwise.

public static bool TrySetPropertyValue(this object obj, string name, object value, Flags bindingFlags)

Sets the first property with the given name on the given obj object to the supplied value. Returns true if a value was assigned to a property and false otherwise. Use the bindingFlags parameter to limit the scope of the search.