public IEntityConverter <TEntity> Build() { var entityType = new SchemaEntityInfo(typeof(TEntity), typeof(TSchema), _entitySelector); var entityFactory = new DynamicEntityFactory <TEntity>(ImplementationType, entityType); return(new DynamicEntityConverter <TEntity, TSchema>(entityType, entityFactory, _properties)); }
public IEntityConverter <TEntity> Build() { var entityType = new SchemaEntityInfo(typeof(TEntity), typeof(TSchema), _entitySelector); var entityFactoryType = typeof(DynamicEntityFactory <,>).MakeGenericType(typeof(TEntity), ImplementationType); var entityFactory = (IEntityFactory <TEntity>)Activator.CreateInstance(entityFactoryType, entityType, _initializers); return(new DynamicEntityConverter <TEntity, TSchema>(entityType, entityFactory, _properties)); }