Example #1
0
        public SetValuePropertySpecification(PropertyInfo property, SetValueProvider <TValue> valueProvider)
            : base(property, 0)
        {
            _valueProvider  = valueProvider;
            _valueConverter = new SetValueConverter <TValue>(valueProvider);

            SetParent();
        }
Example #2
0
 public SetValuePropertyTranslator(Type implementationType, PropertyInfo entityPropertyInfo, PropertyInfo inputPropertyInfo,
                                   SetValueProvider <TInput, TSchema, TPropertyEntity> valueProvider)
 {
     _valueProvider = valueProvider;
     _propertyName  = entityPropertyInfo.Name;
     _property      = new WriteProperty <TEntity, Value <TPropertyEntity> >(implementationType, _propertyName);
     _inputProperty = new ReadOnlyProperty <TInput, Value <TPropertyEntity> >(inputPropertyInfo);
 }
Example #3
0
 public SetValueConverter(SetValueProvider <TValue> valueProvider)
 {
     _valueProvider = valueProvider;
 }
Example #4
0
 public SetValuePropertyTranslatorSpecification(Expression <Func <TResult, Value <TValue> > > propertyExpression, SetValueProvider <TInput, TSchema, TValue> valueProvider) :
     base(propertyExpression)
 {
     _valueProvider = valueProvider;
 }
Example #5
0
        public static void Set <TResult, TEntity, TSchema, T>(this IEntityTranslatorConfigurator <TResult, TEntity, TSchema> configurator,
                                                              Expression <Func <TResult, Value <T> > > propertyExpression, SetValueProvider <TEntity, TSchema, T> valueProvider)
            where TSchema : Entity
            where TEntity : TSchema
            where TResult : TSchema
        {
            var specification = new SetValuePropertyTranslatorSpecification <TResult, T, TEntity, TSchema>(propertyExpression, valueProvider);

            configurator.Add(specification);
        }