Beispiel #1
0
        private void AddPrimaryConstraint(SqlConstraint constraint)
        {
            foreach (var child in constraint.Children)
            {
                if (child is SqlIndexedColumn code)
                {
                    var column = _Table.Columns.FirstOrDefault(c => c.Name == code.Name.Value);
                    if (column == null)
                    {
                        throw new KeyNotFoundException($"Column with the name [{code.Name.Value}] is not a member of table [{_Table.FullName}]");
                    }

                    column.IsPrimaryKey = true;
                }
            }
        }
Beispiel #2
0
 public override void Visit(SqlConstraint codeObject)
 {
 }
 public override void Visit(SqlConstraint codeObject)
 {
     Format(codeObject);
 }