Exemple #1
0
        public string CreateStatement()
        {
            var sb = new StringBuilder(Template);

            sb.Replace("{column-name}", ColumnNameCreator.EscapeName(ColumnName));
            sb.Replace("{type-name}", TypeName);
            sb.Replace("{column-constraint}", ColumnConstraints.CreateStatement());

            return(sb.ToString().Trim());
        }
        public string CreateStatement()
        {
            var sb = new StringBuilder(Template);

            sb.Replace("{foreign-key}", string.Join(", ", ForeignKey.Select(c => ColumnNameCreator.EscapeName(c))));
            sb.Replace("{referenced-table}", ForeignTable);
            sb.Replace("{referenced-id}", string.Join(", ", ForeignPrimaryKey.Select(c => ColumnNameCreator.EscapeName(c))));
            if (CascadeDelete)
            {
                sb.Append(" " + CascadeDeleteStatement);
            }

            return(sb.ToString());
        }
Exemple #3
0
        public string CreateStatement()
        {
            string primaryKeys = String.Join(", ", this.Select(c => ColumnNameCreator.EscapeName(c)));

            return(Template.Replace("{primary-keys}", primaryKeys));
        }