Catel.Reflection.TypeInfoExtensions.GetProperty C# (CSharp) Method

GetProperty() public static method

Gets the property with the specified name.
The is null. The is null or whitespace.
public static GetProperty ( this typeInfo, string name, BindingFlags bindingFlags ) : PropertyInfo
typeInfo this The .
name string The name of the member to retrieve.
bindingFlags BindingFlags The binding flags.
return System.Reflection.PropertyInfo
        public static PropertyInfo GetProperty(this TypeInfo typeInfo, string name, BindingFlags bindingFlags)
        {
            Argument.IsNotNull("typeInfo", typeInfo);
            Argument.IsNotNullOrWhitespace("name", name);

            return (from x in GetProperties(typeInfo, bindingFlags)
                    where x.Name == name
                    select x).FirstOrDefault();
        }