Ejemplo n.º 1
0
        private ColumnProperty(ISQLHelper helper, PropertyInfo info, bool primaryKey = false)
        {
            Info   = info;
            Helper = helper;
            ColumnAttribute attr = ColumnAttribute.GetAttribute(info);

            if (attr != null)
            {
                Name         = attr.Name;
                Type         = attr.Type;
                HasAttribute = true;
                Column       = attr;
            }
            if (Name == null)
            {
                Name = info.Name;
            }
            if (Type == null)
            {
                Type = info.PropertyType;
            }
            IsPrimaryKey = primaryKey || (HasAttribute && Column.IsPrimaryKey);
        }