public SqlFieldDefinition(string name, Type dataType, SqlAttribute attributes = null) { Name = name; SQLDataType = dataType.SQLiteType(); if (attributes == null) { Attributes = new SqlAttribute(); } }
private List <SqlFieldDefinition> getSQLFieldDefinitions() { var l = new List <SqlFieldDefinition>(); foreach (var prop in this.GetType().GetProperties()) { SqlAttribute fieldAttributes = null; Object[] o = prop.GetCustomAttributes(typeof(SqlAttribute), true); if (o.Count() > 1) { fieldAttributes = o[0] as SqlAttribute; } l.Add(new SqlFieldDefinition(prop.Name, prop.PropertyType, fieldAttributes)); } return(l); }