Пример #1
0
        private string ParsePropertyType(PropertyBase property, bool required)
        {
            string type;

            if (property.PrimitiveType.HasValue)
            {
                type = Parse(property.PrimitiveType.Value, true);
            }
            else
            {
                string itemType;
                switch (property.Type)
                {
                case "List":
                    itemType = property.PrimitiveItemType.HasValue ?
                               Parse(property.PrimitiveItemType.Value, true) :
                               property.ItemType;

                    type = $"List<{itemType}>";
                    break;

                case "Map":
                    itemType = property.PrimitiveItemType.HasValue ?
                               Parse(property.PrimitiveItemType.Value, true) :
                               property.ItemType;

                    type = $"Dictionary<string, {itemType}>";
                    break;

                default:
                    type = property.Type;
                    break;
                }
            }

            return(type);
        }