Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }