private static SchemaItem CreateItem(string key, string label, SchemaItemType type, params Validator[] validators)
        {
            key.ThrowIfEmpty(nameof(label));
            if (string.IsNullOrEmpty(label))
            {
                label = key.Humanize(LetterCasing.Title);
            }

            return(new SchemaItem
            {
                Key = key,
                Label = label,
                Type = type,
                Validators = validators
            });
        }
Exemplo n.º 2
0
        private static void ApplyProperties(SchemaItem item, string key, string label, SchemaItemType type, params Validator[] validators)
        {
            key.ThrowIfEmpty(nameof(label));
            if (string.IsNullOrEmpty(label))
            {
                label = key.Humanize(LetterCasing.Title);
            }

            item.Type       = type;
            item.Key        = key;
            item.Label      = label;
            item.Validators = validators;
        }