public Code GetCode()
 => Class("MyProject", "My project description", "1.0.0", null, "MyTypeName",
          usingDirectiveList: UsingDirectiveLists.Create("System", "System.IO"),
          documentationCommentList: Comments.Summary("This is the class XML-doc summary comment"),
          attributeListCollection: AttributeLists.Create(Attributes.ProtoContract()),
          constructorList: ConstructorLists.Create(Constructors.Default("MyTypeName")),
          methodList: MethodLists.Create(Methods.PublicStatic("GetInt", "int", "5 + 5")),
          propertyList: PropertyLists.Create(Properties.Public("MyProperty", "string", "This is the property XML-doc summary comment", AttributeLists.Create(Attributes.ProtoMember(1)))));
예제 #2
0
 public static ClassDeclaration Create(
     string name,
     string @namespace,
     IEnumerable <Method> tests,
     IEnumerable <string> usingDirectives)
 => new ClassDeclaration(
     name,
     @namespace,
     ModifierLists.Public,
     XUnitUsings.Create(usingDirectives),
     methodList: MethodLists.Create(tests.ToArray()));
예제 #3
0
 protected MethodList GetMethodList()
 => Any(Methods)
         ? MethodLists.Create(Methods.Select(method => string.IsNullOrWhiteSpace(method.ArrowClauseExpression) ? new DevOps.Primitives.CSharp.Method(method.Name, method.Type,
                                                                                                                                                     GetParameterList(method.Parameters), GetBlock(method.Block), GetMemberModifierList(method.Modifiers), Comments.Summary(method.Comment), GetAttributeListCollection(method.Attributes)) : new DevOps.Primitives.CSharp.Method(method.Name, method.Type, method.ArrowClauseExpression,
                                                                                                                                                                                                                                                                                                                                                                                  GetParameterList(method.Parameters), GetMemberModifierList(method.Modifiers), Comments.Summary(method.Comment), GetAttributeListCollection(method.Attributes))).ToArray())
         : null;
예제 #4
0
 private static MethodList GetMethodList(IEnumerable <UniqueIndex> uniqueIndexes)
 => uniqueIndexes == null ? null : MethodLists.Create(DbContextOnModelCreating.Create(uniqueIndexes));