Exemple #1
0
        public static Type GetTypeForSchema(this ISchemaTypeMap typeMap, Schema schema)
        {
            Type type;

            if (!typeMap.TryGetTypeForSchema(schema, out type))
            {
                throw new MissingTypeMappingException(schema);
            }
            return(type);
        }
Exemple #2
0
        public static Schema GetSchemaForType(this ISchemaTypeMap typeMap, Type type)
        {
            Schema schema;

            if (!typeMap.TryGetSchemaForType(type, out schema))
            {
                throw new MissingTypeMappingException(schema);
            }
            return(schema);
        }
Exemple #3
0
 public RecordSerializer(ISchemaProvider schemaProvider, ISchemaTypeMap schemaTypeMap, IEditableFactory editableFactory)
 {
     this.schemaProvider  = schemaProvider;
     this.schemaTypeMap   = schemaTypeMap;
     this.editableFactory = editableFactory;
 }
 public ReflectionSchemaBuilder(ISchemaProvider schemaProvider, IEditableFactory editableFactory, ISchemaTypeMap schemaTypeMap)
 {
     this.schemaProvider  = schemaProvider;
     this.editableFactory = editableFactory;
     this.typeMap         = schemaTypeMap;
 }
Exemple #5
0
 public static void MapBidirectional(this ISchemaTypeMap typeMap, string schemaName, Type type)
 {
     typeMap.MapBidirectional(typeMap.SchemaProvider.GetSchemaByName(schemaName), type);
 }
Exemple #6
0
 public static void MapBidirectional(this ISchemaTypeMap typeMap, BuiltInSchema builtInSchema, Type type)
 {
     typeMap.MapBidirectional(Schema.BuiltIn[builtInSchema], type);
 }
Exemple #7
0
 public static void MapBidirectional(this ISchemaTypeMap typeMap, Schema schema, Type type)
 {
     typeMap.MapSchema(schema, type);
     typeMap.MapType(type, schema);
 }