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


C# CodeGenerator.GenerateFromType方法代码示例

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


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

示例1: Char_Default

 public void Char_Default()
 {
     var codeGenerator = new CodeGenerator();
     CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<Char>();
     Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
     Assert.AreEqual(DatabaseColumnType.Char, generatedProperty.DatabaseColumn.Type);
     Assert.AreEqual(1, generatedProperty.DatabaseColumn.Size);
     Assert.AreEqual(MaskType.None, generatedProperty.Mask);
 }
开发者ID:inspira,项目名称:Inspira.AutoGenMvc3,代码行数:9,代码来源:for_platform_modeltypes_without_metadata.cs

示例2: String_Default

 public void String_Default()
 {
     var codeGenerator = new CodeGenerator();
     CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<String>();
     Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
     Assert.AreEqual(DatabaseColumnType.VarChar, generatedProperty.DatabaseColumn.Type);
     Assert.AreEqual(ValidationType.None, generatedProperty.Validation.Type);
     Assert.AreEqual(50, generatedProperty.DatabaseColumn.Size);
     Assert.AreEqual(MaskType.None, generatedProperty.Mask);
 }
开发者ID:inspira,项目名称:Inspira.AutoGenMvc3,代码行数:10,代码来源:for_platform_modeltypes_without_metadata.cs

示例3: Int64_Default

 public void Int64_Default()
 {
     var codeGenerator = new CodeGenerator();
     CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<Int64>();
     Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
     Assert.AreEqual(DatabaseColumnType.BigInt, generatedProperty.DatabaseColumn.Type);
     Assert.AreEqual(8, generatedProperty.DatabaseColumn.Size);
     Assert.AreEqual(ValidationType.Range, generatedProperty.Validation.Type);
     Assert.AreEqual(Int64.MinValue, generatedProperty.Validation.MinimumValue);
     Assert.AreEqual(Int64.MaxValue, generatedProperty.Validation.MaximumValue);
     Assert.AreEqual(MaskType.Integer, generatedProperty.Mask);
 }
开发者ID:inspira,项目名称:Inspira.AutoGenMvc3,代码行数:12,代码来源:for_platform_modeltypes_without_metadata.cs

示例4: DateTime_Default

 public void DateTime_Default()
 {
     var codeGenerator = new CodeGenerator();
     CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<DateTime>();
     Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
     Assert.AreEqual(DatabaseColumnType.DateTime, generatedProperty.DatabaseColumn.Type);
     Assert.AreEqual(ValidationType.Range, generatedProperty.Validation.Type);
     Assert.AreEqual(DateTime.MinValue, generatedProperty.Validation.MinimumValue);
     Assert.AreEqual(DateTime.MaxValue, generatedProperty.Validation.MaximumValue);
     Assert.AreEqual(MaskType.DateTime, generatedProperty.Mask);
 }
开发者ID:inspira,项目名称:Inspira.AutoGenMvc3,代码行数:11,代码来源:for_platform_modeltypes_without_metadata.cs

示例5: Boolean_Default

 public void Boolean_Default()
 {
     var codeGenerator = new CodeGenerator();
     CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<Boolean>();
     Assert.AreEqual(WidgetType.CheckBox, generatedProperty.WidgetType);
     Assert.AreEqual(DatabaseColumnType.Bit, generatedProperty.DatabaseColumn.Type);
     Assert.AreEqual(ValidationType.None, generatedProperty.Validation.Type);
     Assert.AreEqual(MaskType.None, generatedProperty.Mask);
 }
开发者ID:inspira,项目名称:Inspira.AutoGenMvc3,代码行数:9,代码来源:for_platform_modeltypes_without_metadata.cs


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