/// <summary> /// Initializes a new instance of the <see cref="Column"/> class. /// </summary> /// <param name="table">The parent table.</param> /// <param name="name">The column's name.</param> /// <param name="modifier">The modifier.</param> internal Column(Table table, string name, Modifier modifier) { Table = table; IsNullable = true; Name = name; Modifier = modifier; }
/// <summary> /// Initializes a new instance of the <see cref="Update"/> class. /// </summary> /// <param name="table">The table the update belongs to.</param> /// <param name="set">The new column values as key/value pairs.</param> /// <param name="where">The update's where clause key/value pairs.</param> internal Update(Table table, Dictionary<string, object> set, Dictionary<string, object> where) : base(null, Modifier.Alter) { Set = set; Where = where; Table = table; }
/// <summary> /// Initializes a new instance of the <see cref="Insert"/> class. /// </summary> /// <param name="table">The table the insert belongs to.</param> /// <param name="row">The row to insert as key/value pairs in the form of properties of an anonymous object.</param> internal Insert(Table table, object row) : this(table, row.ToDictionary()) { }
/// <summary> /// Initializes a new instance of the <see cref="Insert"/> class. /// </summary> /// <param name="table">The table the insert belongs to.</param> /// <param name="row">The row to insert as key/value pairs.</param> internal Insert(Table table, Dictionary<string, object> row) : base(null, Modifier.Add) { Row = row; Table = table; }
/// <summary> /// Initializes a new instance of the <see cref="Constraint"/> class. /// </summary> /// <param name="table">The <see cref="Table"/> the constraint belongs to.</param> /// <param name="name">The name of the constraint.</param> /// <param name="modifier">The modifier.</param> internal Constraint(Table table, string name, Modifier modifier) : base(name, modifier) { Table = table; }
/// <summary> /// Initializes a new instance of the <see cref="Update"/> class. /// </summary> /// <param name="table">The table the insert belongs to.</param> /// <param name="set">The columns to update as key/value pairs in form of properties of an anonymous object.</param> /// <param name="where">The update's where clause as key/value pairs in form of properties of an anonymous object.</param> internal Update(Table table, object set, object where) : this(table, set.ToDictionary(), where.ToDictionary()) { }
/// <summary> /// Adds a new <see cref="Table"/> with the specified /// <paramref name="name"/> to this <see cref="Database"/>. /// </summary> /// <param name="name">The name.</param> /// <returns>The table.</returns> public Table AddTable(string name) { Table t = new Table(this, name, Modifier.Add); MigrationSteps.Enqueue(t); return t; }
/// <summary> /// Initializes a new instance of the <see cref="ForeignKeyConstraint"/> class. /// </summary> /// <param name="table">The <see cref="Table"/> the constraint belongs to.</param> /// <param name="name">The name of the constraint.</param> /// <param name="modifier">The modifier.</param> internal ForeignKeyConstraint(Table table, string name, Modifier modifier) : base(table, name, modifier) { }