private IStructureSchema CreateSchema(Type type, IStructureTypeConfig typeConfig = null) { typeConfig = typeConfig ?? _typeConfigurations.GetConfiguration(type) ?? _typeConfigurations.Register(type); var structureType = _typeFactory.CreateFor(typeConfig); return(_schemaFactory.CreateSchema(structureType)); }
public StructureSchemas(IStructureTypeFactory structureTypeFactory, IStructureSchemaBuilder structureSchemaBuilder) { Ensure.That(structureTypeFactory, "structureTypeFactory").IsNotNull(); Ensure.That(structureSchemaBuilder, "StructureSchemaBuilder").IsNotNull(); StructureTypeFactory = structureTypeFactory; StructureSchemaBuilder = structureSchemaBuilder; _schemas = new ConcurrentDictionary <Type, IStructureSchema>(); _schemaFactoryFn = t => StructureSchemaBuilder.CreateSchema(StructureTypeFactory.CreateFor(t)); }
internal static IStructureSchema CreateRealFrom <T>() where T : class { return(StructureSchemaBuilder.CreateSchema(StructureTypeFactory.CreateFor <T>())); }