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)))));
public static PropertyList Create(string typeName, IEnumerable <EntityProperty> properties, string primaryKeyType = TypeConstants.Int) { var props = new List <Property> { EntityProperties.PrimaryKey(typeName, primaryKeyType) }; var protobufTag = 2; foreach (var property in properties) { if (property.IsReference) { props.AddRange(EntityProperties.Reference(property, protobufTag)); protobufTag = protobufTag + 2; continue; } props.Add(EntityProperties.Member(property, protobufTag)); protobufTag++; } return(PropertyLists.Create(props.ToArray())); }
public static MsBuildPropertyGroup Create(params MsBuildProperty[] properties) => new MsBuildPropertyGroup(PropertyLists.Create(properties), condition: default(MsBuildCondition));
protected PropertyList GetPropertyList() => Any(Properties) ? PropertyLists.Create(Properties.Select(property => new DevOps.Primitives.CSharp.Property(property.Name, property.Type, AccessorLists.AutoGetSet, GetMemberModifierList(property.Modifiers), Comments.Summary(property.Comment), GetMemberAttributeList(property.Attributes))).ToArray()) : null;
public static PropertyList Create(IEnumerable <DbContextProperty> properties) => PropertyLists.Create( GetProperties(properties).ToArray());