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<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); // add dynamic dictionary property annotation for open types model.AddDynamicPropertyDictionaryAnnotations(edmTypeMap.OpenTypes); return edmTypes; }
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; }
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, 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; }
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 annotation for properties Dictionary<PropertyInfo, IEdmProperty> edmProperties = edmTypeMap.EdmProperties; model.AddClrPropertyInfoAnnotations(edmProperties); model.AddPropertyRestrictionsAnnotations(edmTypeMap.EdmPropertiesRestrictions); return edmTypes; }
public static void AddType(this IRunIntent runIntent, Type type) { runIntent.AddTypes(new[] { type }); }