Example #1
0
		/// <summary>Creates a new column.</summary>
		public CsDbcViewRow_Column(CsDbArcColumn architecture, CsDbcViewRow row)
		{
			Row = row;
			Architecture = architecture;
			if (architecture.Name.StartsWith("Unsigned_"))
				UnsignedVersion = new CsDbcViewRow_UnsignedColumn(this);
		}
Example #2
0
		/// <summary>Associates two tables with each other. Automatically adds this relation to the associated table relation collection.</summary>
		public static CsDbArcRelation Create(string name, CsDbArcColumn primary, CsDbArcColumn foreign)
		{
			var rv = new CsDbArcRelation {Name = name, PrimaryKey = primary, ForeignKey = foreign};
			primary.Owner.AddRelation(rv);
			foreign.Owner.AddRelation(rv);
			return rv;
		}
Example #3
0
		/// <summary>Removes the column from this table and removes all associated relations.</summary>
		public override void RemoveColumn(CsDbArcColumn column)
		{
			if (column.Owner != this)
				throw new InvalidOperationException("the column does not belong to the table.");

			foreach (var relation in Relations.Where(x => x.PrimaryKey == column || x.ForeignKey == column))
			{
				relation.Remove();
			}
			base.RemoveColumn(column);

		}
Example #4
0
		/// <summary>Creates a new column.</summary>
		public CsDbcTableRow_Column(CsDbArcColumn architecture, CsDbCodeDataRow row)
		{
			Row = row;
			Architecture = architecture;
		}