public ContextualSetterSpec(
     ContextualTypeMappingSpec <TTarget, TSource, TContext> mappingSpec,
     Expression <Func <TTarget, TProperty> > propertyExpression)
 {
     _propertyExpression = propertyExpression;
     MappingSpec         = mappingSpec;
 }
Exemple #2
0
 WithConstructor <TTarget, TSource, TContext>(
     this ContextualTypeMappingSpec <TTarget, TSource, TContext> spec,
     Expression <Func <TContext, TTarget> > constructorExpression)
     where TTarget : class
     where TSource : class
 {
     return(new ContextualTypeMappingSpec <TTarget, TSource, TContext>(
                spec.InnerSpec,
                spec.ContextualMappings,
                constructorExpression));
 }
Exemple #3
0
 IgnoringSourceProperty <TTarget, TSource, TContext>(
     this ContextualTypeMappingSpec <TTarget, TSource, TContext> spec,
     string propertyName)
     where TTarget : class
     where TSource : class
 {
     return(new ContextualTypeMappingSpec <TTarget, TSource, TContext>(
                spec.InnerSpec.IgnoringSourceProperty(propertyName),
                spec.ContextualMappings,
                spec.Constructor));
 }
Exemple #4
0
 IgnoringTargetProperty <TTarget, TSource, TProperty, TContext>(
     this ContextualTypeMappingSpec <TTarget, TSource, TContext> spec,
     Expression <Func <TTarget, TProperty> > propertyExpression)
     where TTarget : class
     where TSource : class
 {
     return(new ContextualTypeMappingSpec <TTarget, TSource, TContext>(
                spec.InnerSpec.IgnoringTargetProperty(propertyExpression),
                spec.ContextualMappings,
                spec.Constructor));
 }
Exemple #5
0
 WithCustomMap <TTarget, TSource, TContext>(
     this ContextualTypeMappingSpec <TTarget, TSource, TContext> spec,
     Expression <Func <TTarget, TSource, TContext, TTarget> > expression)
     where TTarget : class
     where TSource : class
 {
     return(new ContextualTypeMappingSpec <TTarget, TSource, TContext>(
                spec.InnerSpec
                .IgnoringNestedSourceProperty(expression)
                .WithTargetValues(spec.InnerSpec.TargetValues.Where(x => !x.IsSupersededBy(expression))),
                new List <Expression>(spec.ContextualMappings)
     {
         expression
     },
                spec.Constructor
                ));
 }