public SCIMSchemaAttributeBuilder AddAttribute(SCIMSchema schema, string name, SCIMSchemaAttributeTypes type, Action<SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
            SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
            SCIMSchemaAttributeReturned returned = SCIMSchemaAttributeReturned.DEFAULT,
            SCIMSchemaAttributeUniqueness uniqueness = SCIMSchemaAttributeUniqueness.NONE, string description = null, bool multiValued = false, List<string> canonicalValues = null)
        {
            var fullPath = $"{_fullPath}.{name}";
            var builder = new SCIMSchemaAttributeBuilder(_scimSchemaAttribute.Id, fullPath, schema, new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name = name,
                MultiValued = multiValued,
                CaseExact = caseExact,
                Required = required,
                Mutability = mutability,
                Returned = returned,
                Uniqueness = uniqueness,
                Type = type,
                Description = description,
                CanonicalValues = canonicalValues,
            });
            if (callback != null)
            {
                callback(builder);
            }

            _schema.AddAttribute(builder.Build());
            return this;
        }
Пример #2
0
        public SCIMSchemaBuilder AddAttribute(string name, SCIMSchemaAttributeTypes type, Action <SCIMSchemaAttributeBuilder> callback = null, bool caseExact = false, bool required = false,
                                              SCIMSchemaAttributeMutabilities mutability = SCIMSchemaAttributeMutabilities.READWRITE,
                                              SCIMSchemaAttributeReturned returned       = SCIMSchemaAttributeReturned.DEFAULT,
                                              SCIMSchemaAttributeUniqueness uniqueness   = SCIMSchemaAttributeUniqueness.NONE, string description = null,
                                              bool multiValued = false, ICollection <string> defaulValueStr = null, ICollection <int> defaultValueInt = null, List <string> canonicalValues = null)
        {
            var builder = new SCIMSchemaAttributeBuilder(null, name, _schema, new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name               = name,
                MultiValued        = multiValued,
                CaseExact          = caseExact,
                Required           = required,
                Mutability         = mutability,
                Returned           = returned,
                Uniqueness         = uniqueness,
                Type               = type,
                Description        = description,
                CanonicalValues    = canonicalValues,
                DefaultValueInt    = defaultValueInt == null ? new List <int>() : defaultValueInt,
                DefaultValueString = defaulValueStr == null ? new List <string>() : defaulValueStr,
                FullPath           = name
            });

            if (callback != null)
            {
                callback(builder);
            }

            _attributes.Add(builder.Build());
            return(this);
        }
 public SCIMSchemaAttributeBuilder AddAttribute(string name, Action<SCIMSchemaAttributeBuilder> callback)
 {
     var fullPath = $"{_fullPath}.{name}";
     var builder = new SCIMSchemaAttributeBuilder(_scimSchemaAttribute.Id, fullPath, _schema, new SCIMSchemaAttribute(Guid.NewGuid().ToString()) { Name = name });
     callback(builder);
     _schema.AddAttribute(_scimSchemaAttribute, builder.Build());
     return this;
 }
Пример #4
0
        public SCIMSchemaBuilder AddAttribute(string name, Action <SCIMSchemaAttributeBuilder> callback)
        {
            var builder = new SCIMSchemaAttributeBuilder(null, name, _schema, new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name = name
            });

            callback(builder);
            _attributes.Add(builder.Build());
            return(this);
        }