コード例 #1
0
        private static Dictionary <Type, IEdmType> AddTypes(this EdmModel model, EdmTypeMap edmTypeMap)
        {
            // build types
            Dictionary <Type, IEdmType> edmTypes = edmTypeMap.EdmTypes;

            // Add an annotate types
            model.AddTypes(edmTypes);
            model.AddClrTypeAnnotations(edmTypes);

            // add annotation for properties
            Dictionary <PropertyInfo, IEdmProperty> edmProperties = edmTypeMap.EdmProperties;

            model.AddClrPropertyInfoAnnotations(edmProperties);
            model.AddClrEnumMemberInfoAnnotations(edmTypeMap);
            model.AddPropertyRestrictionsAnnotations(edmTypeMap.EdmPropertiesRestrictions);
            model.AddPropertiesQuerySettings(edmTypeMap.EdmPropertiesQuerySettings);
            model.AddStructuredTypeQuerySettings(edmTypeMap.EdmStructuredTypeQuerySettings);

            // add dynamic dictionary property annotation for open types
            model.AddDynamicPropertyDictionaryAnnotations(edmTypeMap.OpenTypes);

            // add instance annotation dictionary property annotations
            model.AddInstanceAnnotationsContainer(edmTypeMap.InstanceAnnotatableTypes);

            return(edmTypes);
        }