コード例 #1
0
        public ObjectSchema WithOptionalProperty(string name, object type, params IValidationRule[] rules)
        {
            Properties = Properties ?? new List <PropertySchema>();
            var schema = new PropertySchema(name, type)
            {
                Rules = new List <IValidationRule>(rules)
            };

            schema.MakeOptional();
            return(WithProperty(schema));
        }
コード例 #2
0
 public ObjectSchema WithProperty(PropertySchema schema)
 {
     Properties = Properties ?? new List <PropertySchema>();
     Properties.Add(schema);
     return(this);
 }