Example #1
0
        public DocumentationComplexType(EntityFramework entityFramework, ComplexType complexType)
        {
            this.Name        = complexType.Name;
            this.Description = complexType.GetDescription(entityFramework);
            this.Namespace   = complexType.Namespace;
            this.Properties  = complexType.Properties.Select(p => p.ToDocumentationProperty(entityFramework, complexType)).ToList();
            this.Json        = ODataParser.BuildJsonExample(complexType, entityFramework.DataServices.Schemas);//SampleJsonGenerator.GetSampleJson(entityFramework, complexType).ToString(Formatting.Indented);


            if (complexType.BaseType != null)
            {
                var baseComplexType = entityFramework.DataServices.Schemas.FindTypeWithIdentifier(complexType.BaseType) as ComplexType;
                if (baseComplexType != null)
                {
                    this.BaseType = baseComplexType.Name;
                }
            }
        }