本文整理汇总了C#中FluentMigrator.Expressions.RenameTableExpression类的典型用法代码示例。如果您正苦于以下问题:C# RenameTableExpression类的具体用法?C# RenameTableExpression怎么用?C# RenameTableExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RenameTableExpression类属于FluentMigrator.Expressions命名空间,在下文中一共展示了RenameTableExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanRenameTable
public void CanRenameTable()
{
var expression = new RenameTableExpression();
expression.SchemaName = "dbo";
expression.OldName = "Table1";
expression.NewName = "Table2";
var sql = generator.Generate( expression );
sql.ShouldBe( "sp_rename '[dbo].[Table1]', 'Table2'" );
}
示例2: Table
public IRenameTableToOrInSchemaSyntax Table(string oldName)
{
var expression = new RenameTableExpression { OldName = oldName };
_context.Expressions.Add(expression);
return new RenameTableExpressionBuilder(expression);
}
示例3: Generate
public override string Generate(RenameTableExpression expression)
{
truncator.Truncate(expression);
return compatabilityMode.HandleCompatabilty("Rename table is not supported");
}
示例4: Generate
public override string Generate(RenameTableExpression expression)
{
return String.Format(RenameTable, Quoter.QuoteTableName(expression.OldName), Quoter.QuoteTableName(expression.NewName));
}
示例5: Generate
public override string Generate(RenameTableExpression expression)
{
return string.Format("ALTER TABLE {0}.{1} RENAME TO {2}", Quoter.QuoteSchemaName(expression.SchemaName), Quoter.QuoteTableName(expression.OldName), Quoter.QuoteTableName(expression.NewName));
}
示例6: Process
public virtual void Process(RenameTableExpression expression)
{
Process(Generator.Generate(expression));
}
示例7: Truncate
public void Truncate(RenameTableExpression expression)
{
expression.OldName = Truncate(expression.OldName);
expression.NewName = Truncate(expression.NewName);
}
示例8: Generate
public abstract string Generate(RenameTableExpression expression);
示例9: ErrorIsReturnedWhenNewNameIsEmptyString
public void ErrorIsReturnedWhenNewNameIsEmptyString()
{
var expression = new RenameTableExpression { NewName = String.Empty };
var errors = ValidationHelper.CollectErrors(expression);
errors.ShouldContain(ErrorMessages.NewTableNameCannotBeNullOrEmpty);
}
示例10: ErrorIsNotReturnedWhenOldNameIsNotNullEmptyString
public void ErrorIsNotReturnedWhenOldNameIsNotNullEmptyString()
{
var expression = new RenameTableExpression { OldName = "Bacon" };
var errors = ValidationHelper.CollectErrors(expression);
errors.ShouldNotContain(ErrorMessages.OldTableNameCannotBeNullOrEmpty);
}
示例11: ToStringIsDescriptive
public void ToStringIsDescriptive()
{
var expression = new RenameTableExpression { OldName = "Bacon", NewName = "ChunkyBacon" };
expression.ToString().ShouldBe("RenameTable Bacon ChunkyBacon");
}
示例12: Generate
public override string Generate(RenameTableExpression expression)
{
return String.Format("sp_rename '{0}[{1}]', '{2}'", FormatSchema( expression.SchemaName ), expression.OldName, FormatSqlEscape(expression.NewName));
}
示例13: Generate
public override string Generate(RenameTableExpression expression)
{
return String.Format("sp_rename {0}, {1}", Quoter.QuoteValue(expression.OldName), Quoter.QuoteValue(expression.NewName));
}
示例14: Generate
public override string Generate(RenameTableExpression expression)
{
return FormatExpression("sp_rename [{0}], [{1}]", expression.OldName, expression.NewName);
}
示例15: Generate
public override string Generate(RenameTableExpression expression)
{
return String.Format("RENAME TABLE `{0}` TO `{1}`", expression.OldName, expression.NewName);
}