本文整理汇总了C#中Table.GetQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetQualifiedName方法的具体用法?C# Table.GetQualifiedName怎么用?C# Table.GetQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table.GetQualifiedName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuotedTableNameWithSqlCE
public void QuotedTableNameWithSqlCE()
{
Table tbl = new Table();
tbl.Name = "`Group`";
Assert.AreEqual("\"Group\"", tbl.GetQualifiedName(dialect));
}
示例2: QuotedTableNameWithoutSchemaWithSqlCE
public void QuotedTableNameWithoutSchemaWithSqlCE()
{
Table tbl = new Table();
tbl.Name = "`name`";
Assert.AreEqual("\"name\"", tbl.GetQualifiedName(dialect));
}
示例3: QuotedSchemaNameWithUnqoutedTableInSqlCE
public void QuotedSchemaNameWithUnqoutedTableInSqlCE()
{
Table tbl = new Table();
tbl.Schema = "`schema`";
tbl.Name = "name";
Assert.AreEqual("\"schema_name\"", tbl.GetQualifiedName(dialect));
Assert.AreEqual("\"schema_table\"", dialect.Qualify("", "\"schema\"", "table"));
}
示例4: QuotedCatalogSchemaNameWithSqlCE
public void QuotedCatalogSchemaNameWithSqlCE()
{
Table tbl = new Table();
tbl.Catalog = "dbo";
tbl.Schema = "`schema`";
tbl.Name = "`name`";
Assert.AreEqual("dbo.\"schema_name\"", tbl.GetQualifiedName(dialect));
Assert.AreEqual("dbo.\"schema_table\"", dialect.Qualify("dbo", "\"schema\"", "\"table\""));
}
示例5: SqlCreateClusteredIndexString
private static string SqlCreateClusteredIndexString(Dialect dialect, string name, Table table,
IEnumerable<Column> columns, string defaultCatalog, string defaultSchema)
{
StringBuilder buf = new StringBuilder("CREATE CLUSTERED INDEX ")
.Append(dialect.QualifyIndexName ? name : StringHelper.Unqualify(name))
.Append(" ON ")
.Append(table.GetQualifiedName(dialect, defaultCatalog, defaultSchema))
.Append(" (")
.Append(string.Join(", ", columns.Select(x=> x.GetQuotedName(dialect))))
.Append(")");
return buf.ToString();
}
示例6: BuildSqlDropIndexString
internal static String BuildSqlDropIndexString(Dialect dialect, Table table, String name, String defaultCatalog, String defaultSchema)
{
return "drop index " + (dialect.QualifyIndexName ? StringHelper.Qualify(table.GetQualifiedName(dialect, defaultCatalog, defaultSchema), dialect.Quote(name)) : dialect.Quote(name));
}
示例7: BuildSqlCreateIndexString
internal static String BuildSqlCreateIndexString(Dialect dialect, String name, Table table, IEnumerable<Column> columns, Boolean unique, String defaultCatalog, String defaultSchema)
{
String tableQualifiedName = table.GetQualifiedName(dialect, defaultCatalog, defaultSchema);
StringBuilder sb = StringHelper.CreateBuilder()
.Append("create")
.Append(unique ? " unique" : "")
.Append(" index ")
//.Append(dialect.QualifyIndexName ? name : StringHelper.Unqualify(name))
.Append(dialect.QualifyIndexName ? StringHelper.Qualify(tableQualifiedName, dialect.Quote(name)) : dialect.Quote(name))
.Append(" on ")
.Append(tableQualifiedName)
.Append(" (");
StringHelper.AppendItemsWithComma(columns, delegate(Column column)
{
sb.Append(column.GetQuotedName(dialect));
}, sb);
return sb.Append(")").ToString();
}
示例8: SchemaNameWithSqlCE
public void SchemaNameWithSqlCE()
{
Table tbl = new Table();
tbl.Schema = "schema";
tbl.Name = "name";
Assert.AreEqual("schema_name", tbl.GetQualifiedName(dialect));
Assert.AreEqual("schema_table", dialect.Qualify("", "schema", "table"));
}