Exemplo n.º 1
0
        public override void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            Value <TValue> Factory(TextSlice slice) => new ConvertValue <TValue>(slice, 0, _valueConverter);

            var property = new ValueEntityProperty <TEntity, TValue>(builder.ImplementationType, Property.Name, Position, Factory);

            builder.Add(property);
        }
Exemplo n.º 2
0
        public override void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            IEntityConverter <TEntityValue> entityConverter = builder.GetEntityConverter <TEntityValue>();

            var mapper = new ValueEntityProperty <TEntity, TEntityValue>(builder.ImplementationType, Property.Name, Position, x => Factory(x, entityConverter));

            builder.Add(mapper);
        }
Exemplo n.º 3
0
        public override void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            IEntityConverter <TEntityValue> entityConverter = builder.GetEntityConverter <TEntityValue>();

            var property = new ValueListEntityPropertyConverter <TEntity, TEntityValue>(builder.ImplementationType, Property.Name, Position,
                                                                                        x => new EntityValueList <TEntityValue>(x, entityConverter), SliceProvider);

            builder.Add(property);
        }
Exemplo n.º 4
0
        public override void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            IEntityConverter <TEntityValue> entityConverter = builder.GetEntityConverter <TEntityValue>();

            Value <TEntityValue> Factory(TextSlice slice)
            {
                return(new ConvertValue <TEntityValue>(slice, Position, entityConverter));
            }

            var mapper = new ValueEntityPropertyConverter <TEntity, TEntityValue>(builder.ImplementationType, Property.Name, Factory);

            builder.Add(mapper);
        }
Exemplo n.º 5
0
        public override void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            var mapper = new ValueEntityPropertyConverter <TEntity, TValue>(builder.ImplementationType, Property.Name, GetValue);

            builder.Add(mapper);
        }
Exemplo n.º 6
0
        public override void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            var property = new ValueListEntityProperty <TEntity, TValue>(builder.ImplementationType, Property.Name, Position, GetValue, SliceFactory);

            builder.Add(property);
        }
Exemplo n.º 7
0
        public void Apply(IEntityConverterBuilder <TEntity, TSchema> builder)
        {
            var initializer = new PropertyEntityInitializer <TEntity, TValue>(builder.ImplementationType, _propertyName, _value);

            builder.Add(initializer);
        }