Ejemplo n.º 1
0
 public static SchemaAttribute CreateComplexAttribute(
     string name,
     string description,
     List <SchemaAttribute> subAttributes,
     string type              = Common.Constants.SchemaAttributeTypes.String,
     bool multiValued         = false,
     bool required            = false,
     bool caseExact           = false,
     string mutability        = Common.Constants.SchemaAttributeMutability.ReadWrite,
     string returned          = Common.Constants.SchemaAttributeReturned.Default,
     string uniqueness        = Common.Constants.SchemaAttributeUniqueness.None,
     string[] referenceTypes  = null,
     string[] canonicalValues = null,
     bool isCommon            = false)
 {
     return(new SchemaAttribute
     {
         Id = Guid.NewGuid().ToString(),
         Name = name,
         MultiValued = multiValued,
         Description = description,
         Required = required,
         CaseExact = caseExact,
         Mutability = mutability,
         Returned = returned,
         Uniqueness = uniqueness,
         ReferenceTypes = MappingExtensions.ConcatList(referenceTypes),
         CanonicalValues = MappingExtensions.ConcatList(canonicalValues),
         Children = subAttributes,
         IsCommon = isCommon,
         Type = Common.Constants.SchemaAttributeTypes.Complex
     });
 }