public override void OverrideMapping(IMappingCollection <ClassWithSeveralPropertiesSrc, ClassWithSeveralPropertiesDest, TContext> mapping) { int stringValue = 0; mapping.Set(to => to.Property2, () => stringValue++); mapping.Set(to => to.Property1, () => stringValue++); mapping.Set(to => to.Property3, () => stringValue++); }
public void Set <TMemberType>(Expression <Func <TType2, TMemberType> > toExpression, Expression <Func <TType1, TMemberType> > fromExpression) { if (_mapping != null) { _mapping.Set(toExpression, fromExpression); } else { _reverseMapping.Set(fromExpression, toExpression); } }
public override void OverrideMapping(IMappingCollection <ClassWithSeveralPropertiesSrc, ClassWithSeveralPropertiesDest, CloneableTestContext> mapping) { base.OverrideMapping(mapping); mapping.SetChildContext((from, to, context) => context); mapping.Set(to => to.Child, (from, to, context) => { Assert.AreNotSame(_originalContext, context); return(null); }); }