Example #1
0
        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++);
        }
Example #2
0
 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);
     }
 }
Example #3
0
 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);
     });
 }