当前位置: 首页>>代码示例>>C#>>正文


C# MainViewModel.AsDynamic方法代码示例

本文整理汇总了C#中MainViewModel.AsDynamic方法的典型用法代码示例。如果您正苦于以下问题:C# MainViewModel.AsDynamic方法的具体用法?C# MainViewModel.AsDynamic怎么用?C# MainViewModel.AsDynamic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainViewModel的用法示例。


在下文中一共展示了MainViewModel.AsDynamic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateUpdateStatementTest

 public void CreateUpdateStatementTest()
 {
     var vm = new MainViewModel();
     var testCase = new[] {
         new { Input = new { TableName = "TEST", Colums = new[] { "A" } },
               Answer = "update TEST set A = @a" },
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "B" } },
               Answer = "update TEST set A = @a, B = @b" },
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "Index" } },
               Answer = "update TEST set A = @a, 'Index' = @index" }
     };
     foreach (var test in testCase)
     {
         var result = (string)vm.AsDynamic().CreateUpdateStatement(test.Input.TableName, test.Input.Colums);
         result.Is(test.Answer);
     }
 }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:17,代码来源:MainViewModelTest.cs

示例2: CreateInsertStatementTest

 public void CreateInsertStatementTest()
 {
     var vm = new MainViewModel();
     var testCase = new[] {
         new { Input = new { TableName = "TEST", Colums = new[] { "A" } },
               Answer = "insert into TEST (A) values (@a)" },
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "B" } },
               Answer = "insert into TEST (A, B) values (@a, @b)" },
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "Index" } },
               Answer = "insert into TEST (A, 'Index') values (@a, @index)" }
     };
     foreach (var test in testCase)
     {
         var result = (string)vm.AsDynamic().CreateInsertStatement(test.Input.TableName, test.Input.Colums);
         result.Is(test.Answer);
     }
 }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:17,代码来源:MainViewModelTest.cs

示例3: CreateSelectStatementTest

 public void CreateSelectStatementTest()
 {
     var vm = new MainViewModel();
     var testCase = new[] {
         new { Input = new { TableName = "TEST", Colums = new[] { "A" }, Limit = 0 },
               Answer = "select A from TEST"},
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "B" } , Limit = 0},
               Answer = "select A, B from TEST"},
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "Index" }  , Limit = 0},
               Answer = "select A, 'Index' from TEST"},
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "B" } , Limit = 10},
               Answer = "select first(10) A, B from TEST" },
         new { Input = new { TableName = "TEST", Colums = new[] { "A", "B" } , Limit = 1000},
               Answer = "select first(1000) A, B from TEST" }
     };
     foreach (var test in testCase)
     {
         var result = (string)vm.AsDynamic().CreateSelectStatement(test.Input.TableName, test.Input.Colums, test.Input.Limit);
         result.Is(test.Answer);
     }
 }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:21,代码来源:MainViewModelTest.cs


注:本文中的MainViewModel.AsDynamic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。