Пример #1
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(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
            });

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

            _attributes.Add(builder.Build());
            return(this);
        }
        public SCIMSchemaAttributeBuilder 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)
        {
            var builder = new SCIMSchemaAttributeBuilder(new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name        = name,
                MultiValued = multiValued,
                CaseExact   = caseExact,
                Required    = required,
                Mutability  = mutability,
                Returned    = returned,
                Uniqueness  = uniqueness,
                Type        = type,
                Description = description
            });

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

            _scimSchemaAttribute.AddSubAttribute(builder.Build());
            return(this);
        }
Пример #3
0
        public SCIMSchemaBuilder AddAttribute(string name, Action <SCIMSchemaAttributeBuilder> callback)
        {
            var builder = new SCIMSchemaAttributeBuilder(new SCIMSchemaAttribute(Guid.NewGuid().ToString())
            {
                Name = name
            });

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