ActiveRecordPattern.ActiveRecordBase.propertyNames C# (CSharp) Method

propertyNames() protected static method

Возращает имена колонок для даного типа класса.
protected static propertyNames ( Type Type ) : string[]
Type System.Type
return string[]
        protected static string[] propertyNames(Type Type)
        {
            PropertyInfo[] properies = Type.GetProperties();
            List<string> colomnNames = new List<string>();
            foreach (PropertyInfo property in properies)
            {
                if (Attribute.IsDefined(property, typeof(PropertyRecord)))
                {
                    var attributeValue =
                        Attribute.GetCustomAttribute(property, typeof(PropertyRecord)) as PropertyRecord;

                    if (attributeValue.Name != null) colomnNames.Add(attributeValue.Name);
                    else colomnNames.Add(property.Name);
                }
            }

            return colomnNames.ToArray();
        }