Exemple #1
0
 /// <summary>
 /// Creates a field with the specified values
 /// </summary>
 /// <param name="name">The name of the column.</param>
 /// <param name="dbName">The database name of the column.</param>
 /// <param name="id">Specifies the field is the primary key of an entity, defaults to false.</param>
 /// <param name="defaultVal">Overrides the value of a field if it's specified, for example if you want to default the value of a date field to GETDATE()</param>
 /// <param name="dataType">Specifies the field data type</param>
 /// <param name="insertable">Specifies whether the column is included in SQL INSERT statements generated by the <see cref="T:EPE.Common.Utils.QueryBuilder"/>, defaults to true.</param>
 /// <param name="updatable">Specifies whether the column is included in SQL UPDATE statements generated by the <see cref="T:EPE.Common.Utils.QueryBuilder"/>, defaults to true.</param>
 /// <param name="foreignKey">Specifies that the Entity will be join with another table using this field. This is only used in SQL SELECT statements  generated by the <see cref="T:EPE.Common.Utils.QueryBuilder"/>, defaults to null.</param>
 public Field(string name, string dbName, bool id, string defaultVal, DBType dataType, bool insertable, bool updatable, ForeignKeyInfo foreignKey)
 {
     this.Name       = name;
     this.DBName     = dbName;
     this.Id         = id;
     this.DefaultVal = defaultVal;
     this.DataType   = dataType;
     this.Insertable = insertable;
     this.Updatable  = updatable;
     this.ForeignKey = foreignKey;
 }
Exemple #2
0
 /// <summary>
 /// Creates a field with the specified name, data type and foreign key
 /// </summary>
 /// <param name="name">The name of the column.</param>
 /// <param name="dataType">Specifies the field data type.</param>
 /// <param name="foreignKey">Specifies that the Entity will be join with another table using this field. This is only used in SQL SELECT statements.</param>
 public Field(string name, DBType dataType, ForeignKeyInfo foreignKey)
     : this(name, false, "", dataType, true, true, foreignKey)
 {
 }
Exemple #3
0
 /// <summary>
 /// Creates a field with the specified values
 /// </summary>
 /// <param name="name">The name of the column.</param>
 /// <param name="id">Specifies the field is the primary key of an entity, defaults to false.</param>
 /// <param name="defaultVal">Overrides the value of a field if it's specified, for example if you want to default the value of a date field to GETDATE()</param>
 /// <param name="dataType">Specifies the field data type</param>
 /// <param name="insertable">Specifies whether the column is included in SQL INSERT statements generated by the <see cref="T:EPE.Common.Utils.QueryBuilder"/>, defaults to true.</param>
 /// <param name="updatable">Specifies whether the column is included in SQL UPDATE statements generated by the <see cref="T:EPE.Common.Utils.QueryBuilder"/>, defaults to true.</param>
 /// <param name="foreignKey">Specifies that the Entity will be join with another table using this field. This is only used in SQL SELECT statements  generated by the <see cref="T:EPE.Common.Utils.QueryBuilder"/>, defaults to null.</param>
 public Field(string name, bool id, string defaultVal, DBType dataType, bool insertable, bool updatable, ForeignKeyInfo foreignKey) :
     this(name, name, id, defaultVal, dataType, insertable, updatable, foreignKey)
 {
 }
Exemple #4
0
 /// <summary>
 /// Creates a field with the specified name and foreign key
 /// </summary>
 /// <param name="name">The name of the column.</param>
 /// <param name="foreignKey">Specifies that the Entity will be join with another table using this field. This is only used in SQL SELECT statements.</param>
 public Field(string name, ForeignKeyInfo foreignKey)
     : this(name, false, "", DBType.Varchar, true, true, foreignKey)
 {
 }