Esempio n. 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);
        }
Esempio n. 2
0
        private static Dictionary <Type, IEdmStructuredType> AddTypes(this EdmModel model, IEnumerable <StructuralTypeConfiguration> types)
        {
            StructuralTypeConfiguration[] configTypes = types.ToArray();

            // build types
            Dictionary <Type, IEdmStructuredType> edmTypes = EdmTypeBuilder.GetTypes(configTypes);

            // Add an annotate types
            model.AddTypes(edmTypes);
            model.AddClrTypeAnnotations(edmTypes);
            return(edmTypes);
        }
        private static Dictionary <string, IEdmStructuredType> AddTypes(this EdmModel model, IEnumerable <IStructuralTypeConfiguration> types)
        {
            IStructuralTypeConfiguration[] configTypes = types.ToArray();
            // build types
            IEdmStructuredType[] edmTypes = EdmTypeBuilder.GetTypes(configTypes).ToArray();
            // index types
            Dictionary <string, IEdmStructuredType> edmTypeMap = edmTypes.ToDictionary(t => (t as IEdmSchemaType).FullName());

            // Add an annotate types
            model.AddTypes(edmTypes);
            model.AddClrTypeAnnotations(GenerateEdmToClrMap(configTypes, edmTypeMap));
            return(edmTypeMap);
        }
        private static Dictionary <Type, IEdmStructuredType> AddTypes(this EdmModel model, IEnumerable <StructuralTypeConfiguration> types)
        {
            StructuralTypeConfiguration[] configTypes = types.ToArray();

            // build types
            EdmTypeMap edmTypeMap = EdmTypeBuilder.GetTypesAndProperties(configTypes);
            Dictionary <Type, IEdmStructuredType> edmTypes = edmTypeMap.EdmTypes;

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

            // Add direct value annotation
            model.AddDirectValueAnnotations(edmTypeMap.DirectValueAnnotations);

            return(edmTypes);
        }
Esempio n. 5
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.AddPropertyRestrictionsAnnotations(edmTypeMap.EdmPropertiesRestrictions);

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

            return(edmTypes);
        }
Esempio n. 6
0
        private static Dictionary <Type, IEdmType> AddTypes(this EdmModel model, IEnumerable <StructuralTypeConfiguration> types,
                                                            IEnumerable <EnumTypeConfiguration> enumTypes)
        {
            IEnumerable <IEdmTypeConfiguration> configTypes = types.Concat <IEdmTypeConfiguration>(enumTypes);

            // build types
            EdmTypeMap edmTypeMap = EdmTypeBuilder.GetTypesAndProperties(configTypes);
            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.AddPropertyRestrictionsAnnotations(edmTypeMap.EdmPropertiesRestrictions);
            return(edmTypes);
        }