Build() public méthode

public Build ( ColumnConstraintInfo &constraint ) : SqlTableColumn
constraint ColumnConstraintInfo
Résultat SqlTableColumn
        public static ICreateTableStatementBuilder WithColumn(this ICreateTableStatementBuilder builder, Action<IColumnBuilder> column)
        {
            var columnBuilder = new ColumnBuilder();
            column(columnBuilder);

            ColumnConstraintInfo constraint;
            var columnResult = columnBuilder.Build(out constraint);

            if (constraint != null)
                builder.WithConstraint(new SqlTableConstraint(constraint.ConstraintType, new []{columnResult.ColumnName}) {
                    ReferenceTable = constraint.ReferencedTable == null ? null : constraint.ReferencedTable.ToString(),
                    ReferenceColumns = new []{constraint.ReferencedColumnName},
                    OnUpdate = constraint.ActionOnUpdate,
                    OnDelete = constraint.ActionOnDelete
                });

            return builder.WithColumn(columnResult);
        }
Exemple #2
0
        public static ICreateTableStatementBuilder WithColumn(this ICreateTableStatementBuilder builder, Action <IColumnBuilder> column)
        {
            var columnBuilder = new ColumnBuilder();

            column(columnBuilder);

            ColumnConstraintInfo constraint;
            var columnResult = columnBuilder.Build(out constraint);

            if (constraint != null)
            {
                builder.WithConstraint(new SqlTableConstraint(constraint.ConstraintType, new [] { columnResult.ColumnName })
                {
                    ReferenceTable   = constraint.ReferencedTable == null ? null : constraint.ReferencedTable.ToString(),
                    ReferenceColumns = new [] { constraint.ReferencedColumnName },
                    OnUpdate         = constraint.ActionOnUpdate,
                    OnDelete         = constraint.ActionOnDelete
                });
            }

            return(builder.WithColumn(columnResult));
        }