コード例 #1
0
        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);
        }