本文整理汇总了C#中Schema.GetDatabaseTables方法的典型用法代码示例。如果您正苦于以下问题:C# Schema.GetDatabaseTables方法的具体用法?C# Schema.GetDatabaseTables怎么用?C# Schema.GetDatabaseTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema.GetDatabaseTables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SyncEnums
private static SqlPreCommand SyncEnums(Schema schema, Table table, Dictionary<string, Entity> current, Dictionary<string, Entity> should)
{
var deletes = Synchronizer.SynchronizeScript(
should,
current,
null,
(str, c) => table.DeleteSqlSync(c, comment: c.toStr),
null, Spacing.Double);
var moves = Synchronizer.SynchronizeScript(
should,
current,
null,
null,
(str, s, c) =>
{
if (s.id == c.id)
return table.UpdateSqlSync(c, comment: c.toStr);
var insert = table.InsertSqlSync(s);
var move = (from t in schema.GetDatabaseTables()
from col in t.Columns.Values
where col.ReferenceTable == table
select new SqlPreCommandSimple("UPDATE {0} SET {1} = {2} WHERE {1} = {3} -- {4} re-indexed"
.FormatWith(t.Name, col.Name, s.Id, c.Id, c.toStr)))
.Combine(Spacing.Simple);
var delete = table.DeleteSqlSync(c, comment: c.toStr);
return SqlPreCommand.Combine(Spacing.Simple, insert, move, delete);
}, Spacing.Double);
var creates = Synchronizer.SynchronizeScript(
should,
current,
(str, s) => table.InsertSqlSync(s),
null,
null, Spacing.Double);
return SqlPreCommand.Combine(Spacing.Double, deletes, moves, creates);
}