Ejemplo 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));
        }
Ejemplo 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));
        }