public override void Apply(IEntityMapBuilder <TEntity, TSchema> builder)
        {
            var property = new ValueArrayEntityProperty <TEntity, TValue>(builder.ImplementationType, Property.Name, Position, GetValue, _sliceFactory);

            ITextSliceProvider <TEntity> provider = new ValueArraySliceProvider <TEntity, TValue>(Property, _valueFormatter);

            builder.Add(property, provider);
        }
Esempio n. 2
0
        public override void Apply(IEntityMapBuilder <TEntity, TSchema> builder)
        {
            ValueArrayFactory <TValue> factory = fragment => new EntityValueArray <TValue>(fragment, _valueConverter);

            var mapper = new ValueArrayEntityProperty <TEntity, TValue>(builder.ImplementationType, Property.Name, Position, factory, Single);

            ITextSliceProvider <TEntity> provider = new ValueArraySliceProvider <TEntity, TValue>(Property, _valueFormatter);

            builder.Add(mapper, provider);
        }
        public override void Apply(IEntityMapBuilder <TEntity, TSchema> builder)
        {
            IEntityMap <TEntityValue> entityMap = builder.GetEntityMap <TEntityValue>();

            var property = new ValueArrayEntityProperty <TEntity, TEntityValue>(builder.ImplementationType, Property.Name, Position,
                                                                                x => new EntityValueArray <TEntityValue>(x, entityMap), _sliceFactory);

            ITextSliceProvider <TEntity> provider = new ValueArraySliceProvider <TEntity, TEntityValue>(Property, new EntityValueFormatter <TEntityValue>(entityMap));

            builder.Add(property, provider);
        }
        public override void Apply(IEntityMapBuilder <TEntity, TSchema> builder)
        {
            var mapper = new ValueArrayEntityProperty <TEntity, TValue>(builder.ImplementationType, Property.Name, Position, GetValue, _sliceFactory);

            // TODO will need formatter eventually cached,shared

            IValueFormatter <TValue> formatter = new ToStringValueFormatter <TValue>();

            ITextSliceProvider <TEntity> provider = new ValueArraySliceProvider <TEntity, TValue>(Property, formatter);

            builder.Add(mapper, provider);
        }