/// <summary>
        /// Given metadata attribute and PropertyInfo.
        /// </summary>
        /// <param name="cellAttribute"></param>
        /// <param name="propertyInfo"></param>
        /// <param name="isPrimaryId"></param>
        /// <param name="publicOnly"></param>
        public MetaSqliteCell(PropertyInfo propertyInfo, CellDataTypes cellDataType, bool publicOnly, bool isPrimaryKey)
        {
            this.OriginalType = propertyInfo.PropertyType;

            this.ColumnName  = propertyInfo.Name;
            this.IsPrimaryId = isPrimaryKey;

            this.CellAttribute = new SqliteCellAttribute(propertyInfo.Name, cellDataType, isPrimaryKey);

            this.GetValueMethod = propertyInfo.GetGetMethod(nonPublic: !publicOnly);
            this.SetValueMethod = propertyInfo.GetSetMethod(nonPublic: !publicOnly);
        }
Example #2
0
 /// <summary>
 /// Create a new attribute to be used to store meta data used by SQLite EZ Mode.
 /// </summary>
 /// <param name="dataType">The SQLite DataType that this property should be mapped to.</param>
 /// <param name="isPrimaryId">True if this property is an integer that should be mapped as a SQLite primary key.</param>
 public SqliteCellAttribute(CellDataTypes dataType, bool isPrimaryId = false)
 {
     this.DataType    = dataType;
     this.IsPrimaryId = isPrimaryId;
 }
Example #3
0
 /// <summary>
 /// Create a new attribute to be used to store meta data used by SQLite EZ Mode.
 /// </summary>
 /// <param name="columnName">The column name that should be mapped to this property.</param>
 /// <param name="dataType">The SQLite DataType that this property should be mapped to.</param>
 /// <param name="isPrimaryId">True if this property is an integer that should be mapped as a SQLite primary key.</param>
 public SqliteCellAttribute(string columnName, CellDataTypes dataType, bool isPrimaryId = false)
 {
     this.ColumnName  = columnName;
     this.DataType    = dataType;
     this.IsPrimaryId = isPrimaryId;
 }