Beispiel #1
0
        /// <summary>
        ///     Creates a new indexed column within the index.
        /// </summary>
        public DomainTableConstraintColumn CreateColumn()
        {
            DomainTableConstraintColumn column = new DomainTableConstraintColumn(this);

            _constraintColumns.Add(column);
            return(column);
        }
        /// <summary>
        ///     Parses a data record into a <see cref="DatabaseConstraintColumn" /> instance.
        /// </summary>
        private DomainTableConstraintColumn ParseConstraintColumn(DomainTableConstraint constraint, IDataRecord record)
        {
            DomainTableConstraintColumn constraintColumn = constraint.CreateColumn();

            constraintColumn.ConstraintColumn = constraint.Table.TableColumns.FirstOrDefault(column => column.ColumnName == record["column_name"].ConvertTo <String>());
            constraintColumn.ReferencedColumn = constraint.ReferencedTable.TableColumns.FirstOrDefault(column => column.ColumnName == record["column_reference"].ConvertTo <String>());
            return(constraintColumn);
        }
Beispiel #3
0
 /// <summary>
 ///     Deserialises the version history from the specified xml element.
 /// </summary>
 internal static void Deserialise(DomainTableConstraint constraint, XmlNode parentNode)
 {
     foreach (XmlNode xmlNode in parentNode.SelectNodes("column"))
     {
         DomainTableConstraintColumn result = constraint.CreateColumn();
         result.Deserialise(xmlNode);
     }
 }
Beispiel #4
0
 /// <summary>
 ///     Deserialises the version history from the specified xml element.
 /// </summary>
 internal static void Deserialise(DomainTable table, XmlNode parentNode)
 {
     foreach (XmlNode xmlNode in parentNode.SelectNodes("constraint"))
     {
         DomainTableConstraint result = table.CreateConstraint();
         result.Deserialise(xmlNode);
         DomainTableConstraintColumn.Deserialise(result, xmlNode);
     }
 }