示例#1
0
 private IEdmComplexType AddComplexType(ResourceType resourceType, string resourceTypeNamespace)
 {
     Action<MetadataProviderEdmComplexType> propertyLoadAction = delegate (MetadataProviderEdmComplexType type) {
         IEnumerable<ResourceProperty> allVisiblePropertiesDeclaredInThisType = this.GetAllVisiblePropertiesDeclaredInThisType(resourceType);
         if (allVisiblePropertiesDeclaredInThisType != null)
         {
             foreach (ResourceProperty property in allVisiblePropertiesDeclaredInThisType)
             {
                 this.CreateProperty(type, property);
             }
         }
     };
     MetadataProviderEdmComplexType schemaType = new MetadataProviderEdmComplexType(resourceTypeNamespace, resourceType.Name, (resourceType.BaseType != null) ? ((IEdmComplexType) this.EnsureSchemaType(resourceType.BaseType)) : null, false, propertyLoadAction);
     this.CacheSchemaType(schemaType);
     MetadataProviderUtils.ConvertCustomAnnotations(this, resourceType.CustomAnnotations, schemaType);
     return schemaType;
 }
示例#2
0
        private IEdmComplexType AddComplexType(ResourceType resourceType, string resourceTypeNamespace)
        {
            Action <MetadataProviderEdmComplexType> propertyLoadAction = delegate(MetadataProviderEdmComplexType type) {
                IEnumerable <ResourceProperty> allVisiblePropertiesDeclaredInThisType = this.GetAllVisiblePropertiesDeclaredInThisType(resourceType);
                if (allVisiblePropertiesDeclaredInThisType != null)
                {
                    foreach (ResourceProperty property in allVisiblePropertiesDeclaredInThisType)
                    {
                        this.CreateProperty(type, property);
                    }
                }
            };
            MetadataProviderEdmComplexType schemaType = new MetadataProviderEdmComplexType(resourceTypeNamespace, resourceType.Name, (resourceType.BaseType != null) ? ((IEdmComplexType)this.EnsureSchemaType(resourceType.BaseType)) : null, false, propertyLoadAction);

            this.CacheSchemaType(schemaType);
            MetadataProviderUtils.ConvertCustomAnnotations(this, resourceType.CustomAnnotations, schemaType);
            return(schemaType);
        }