Пример #1
0
        protected static void AddStringProperties(INakedObjectSpecificationSurface spec, int?maxLength, string pattern, Dictionary <string, object> exts)
        {
            if (spec.IsParseable())
            {
                if (maxLength != null)
                {
                    exts.Add(JsonPropertyNames.MaxLength, maxLength);
                }

                if (!string.IsNullOrEmpty(pattern))
                {
                    exts.Add(JsonPropertyNames.Pattern, pattern);
                }

                if (spec.IsDateTime())
                {
                    exts.Add(JsonPropertyNames.Format, PredefinedType.Date_time.ToRoString());
                }
            }
        }