Adf.Base.Data.BusinessDescriber.GetColumn C# (CSharp) Method

GetColumn() public static method

Provide a null value column by the specified type of System.Type and column name.
Name is null. The object does not match the target type, or a property is an instance property but obj is null.
public static GetColumn ( Type type, string name ) : ColumnDescriber
type System.Type The property value of used to create the .
name string Column name use to create the .
return ColumnDescriber
        public static ColumnDescriber GetColumn(Type type, string name)
        {
            if (type == null) return null;

            var memberInfos = type.GetMember(name, (BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy));
            var mi = memberInfos.Length > 0 ? memberInfos[0] : null;

            if (ExcludeAttribute.IsExcluded(mi)) return null;

            var propertyInfo = mi as PropertyInfo;
            if (propertyInfo != null) return propertyInfo.GetValue(null, null) as ColumnDescriber;

            var fieldInfo = mi as FieldInfo;
            if (fieldInfo != null) return fieldInfo.GetValue(null) as ColumnDescriber;

            return null;
        }