本文整理汇总了C#中Moo.DB.MooDB.ExecuteStoreCommand方法的典型用法代码示例。如果您正苦于以下问题:C# MooDB.ExecuteStoreCommand方法的具体用法?C# MooDB.ExecuteStoreCommand怎么用?C# MooDB.ExecuteStoreCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Moo.DB.MooDB
的用法示例。
在下文中一共展示了MooDB.ExecuteStoreCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainLoop
static int MainLoop()
{
using (MooDB db = new MooDB())
{
db.ExecuteStoreCommand("DELETE FROM [dbo].[Logs] WHERE [CreateTime] < @minTime", new SqlParameter("minTime", DateTimeOffset.Now.AddMonths(-1)));
db.SaveChanges();
}
return 5 * 60 * 1000;
}
示例2: FixDatabase
static void FixDatabase(MooDB db)
{
db.ExecuteStoreCommand("CREATE UNIQUE INDEX IX_Users_Name ON [dbo].[Users] ([Name])");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_TranditionalTestCase] DROP CONSTRAINT [FK_TranditionalTestCase_inherits_TestCase];");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_TranditionalTestCase] ADD CONSTRAINT [FK_TranditionalTestCase_inherits_TestCase] FOREIGN KEY ([ID]) REFERENCES [dbo].[TestCases]([ID]) ON DELETE CASCADE;");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_SpecialJudgedTestCase] DROP CONSTRAINT [FK_SpecialJudgedTestCase_inherits_TestCase];");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_SpecialJudgedTestCase] ADD CONSTRAINT [FK_SpecialJudgedTestCase_inherits_TestCase] FOREIGN KEY ([ID]) REFERENCES [dbo].[TestCases]([ID]) ON DELETE CASCADE;");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_InteractiveTestCase] DROP CONSTRAINT [FK_InteractiveTestCase_inherits_TestCase];");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_InteractiveTestCase] ADD CONSTRAINT [FK_InteractiveTestCase_inherits_TestCase] FOREIGN KEY ([ID]) REFERENCES [dbo].[TestCases]([ID]) ON DELETE CASCADE;");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_AnswerOnlyTestCase] DROP CONSTRAINT [FK_AnswerOnlyTestCase_inherits_TestCase];");
db.ExecuteStoreCommand("ALTER TABLE [dbo].[TestCases_AnswerOnlyTestCase] ADD CONSTRAINT [FK_AnswerOnlyTestCase_inherits_TestCase] FOREIGN KEY ([ID]) REFERENCES [dbo].[TestCases]([ID]) ON DELETE CASCADE;");
}