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 UsingDirectiveList Create(
     IEnumerable <DbContextProperty> properties,
     string dbContextNamespace,
     IEnumerable <string> additionalUsings = null)
 => UsingDirectiveLists.Create(
     GetUsings(properties)
     .Where(u => u != dbContextNamespace)
     .Union(additionalUsings ?? new string[] { })
     .ToArray());
 public static UsingDirectiveList Create(params string[] usings)
 => UsingDirectiveLists.Create(
     GetUsings(usings));
Пример #4
0
 protected UsingDirectiveList GetUsingDirectiveList()
 => Any(UsingDirectives) || Any(UsingStaticDirectives)
         ? UsingDirectiveLists.Create(
     (UsingDirectives?.Select(each => DevOps.Primitives.CSharp.Helpers.Common.UsingDirectives.Using(each)) ?? new UsingDirective[] { })
     .Concat((UsingStaticDirectives?.Select(each => DevOps.Primitives.CSharp.Helpers.Common.UsingDirectives.UsingStatic(each)) ?? new UsingDirective[] { })).ToArray())
         : null;
 public static UsingDirectiveList Create(IEnumerable <string> usingDirectives)
 => UsingDirectiveLists.Create(
     GetUsings(usingDirectives));