本文整理汇总了C#中IStructureSchema.GetIndexesTableNames方法的典型用法代码示例。如果您正苦于以下问题:C# IStructureSchema.GetIndexesTableNames方法的具体用法?C# IStructureSchema.GetIndexesTableNames怎么用?C# IStructureSchema.GetIndexesTableNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStructureSchema
的用法示例。
在下文中一共展示了IStructureSchema.GetIndexesTableNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Drop
public override void Drop(IStructureSchema structureSchema)
{
Ensure.That(structureSchema, "structureSchema").IsNotNull();
var indexesTableNames = structureSchema.GetIndexesTableNames();
var sql = SqlStatements.GetSql("DropStructureTables").Inject(
indexesTableNames.IntegersTableName,
indexesTableNames.FractalsTableName,
indexesTableNames.BooleansTableName,
indexesTableNames.DatesTableName,
indexesTableNames.GuidsTableName,
indexesTableNames.StringsTableName,
indexesTableNames.TextsTableName,
structureSchema.GetUniquesTableName(),
structureSchema.GetStructureTableName());
using (var cmd = CreateCommand(sql, new DacParameter("entityName", structureSchema.Name)))
{
cmd.ExecuteNonQuery();
}
}
示例2: ClearQueryIndexes
public override void ClearQueryIndexes(IStructureSchema structureSchema)
{
Ensure.That(structureSchema, "structureSchema").IsNotNull();
var sqlFormat = SqlStatements.GetSql("EmptyTable");
var indexesTables = structureSchema.GetIndexesTableNames();
using(var cmd = CreateCommand(null))
{
foreach (var tableName in indexesTables.All)
{
cmd.CommandText = sqlFormat.Inject(tableName);
cmd.ExecuteNonQuery();
}
}
}
示例3: CreateGroupedIndexInsertActions
protected virtual IndexInsertAction[] CreateGroupedIndexInsertActions(IStructureSchema structureSchema, IStructure[] structures)
{
var indexesTableNames = structureSchema.GetIndexesTableNames();
var insertActions = new Dictionary<DataTypeCode, IndexInsertAction>(indexesTableNames.All.Length);
foreach (var group in structures.SelectMany(s => s.Indexes).GroupBy(i => i.DataTypeCode))
{
var insertAction = CreateIndexInsertActionGroup(structureSchema, indexesTableNames, group.Key, group.ToArray());
if (insertAction.HasData)
insertActions.Add(group.Key, insertAction);
}
var mergeStringsAndEnums = insertActions.ContainsKey(DataTypeCode.String) && insertActions.ContainsKey(DataTypeCode.Enum);
if (mergeStringsAndEnums)
{
var strings = insertActions[DataTypeCode.String];
var enums = insertActions[DataTypeCode.Enum];
insertActions.Remove(DataTypeCode.Enum);
insertActions[DataTypeCode.String] = CreateIndexInsertActionGroup(structureSchema, indexesTableNames, DataTypeCode.String, strings.Data.MergeWith(enums.Data).ToArray());
}
return insertActions.Values.ToArray();
}