ReflectionExtensions.GetProperty C# (CSharp) Method

GetProperty() public static method

public static GetProperty ( this type, string propertyName ) : PropertyInfo
type this
propertyName string
return PropertyInfo
    public static PropertyInfo GetProperty(this Type type, string propertyName)
    {
        return GetProperty(type, propertyName, (BindingFlags)0x0);
    }

Same methods

ReflectionExtensions::GetProperty ( this type, string propertyName, BindingFlags, flags ) : PropertyInfo
ReflectionExtensions::GetProperty ( this type, string propertyName, Type returnType ) : PropertyInfo

Usage Example

Ejemplo n.º 1
0
        public static void SetValue(this object obj, string propertyName, object value)
        {
            var type     = obj.GetType();
            var property = ReflectionExtensions.GetProperty(type, propertyName);

            property.SetValue(obj, value, null);
        }
All Usage Examples Of ReflectionExtensions::GetProperty