/// <summary> /// Adds the mapping action. /// </summary> /// <param name="sourceMemberName">Name of the source member.</param> /// <param name="targetMemberName">The target member member.</param> /// <param name="mappingAction">The mapping action.</param> public void AddMappingAction( string sourceMemberName, string targetMemberName, MappingAction <TSource, TTarget> mappingAction) { var info = new DelegateMappingInfo <TSource, TTarget>(sourceMemberName, targetMemberName, mappingAction); AddMappingInfo(info); }
public void AddTest() { var m1 = new DelegateMappingInfo<TestClassE, TestClassB>("Prop1", "Prop2", (f, t) => { }); var m2 = new DelegateMappingInfo<TestClassE, TestClassB>("Prop1", "Prop3", (f, t) => { }); var target = new TypeMappingInfo<TestClassE, TestClassB>(); target.Add(m1); target.Add(m2); Assert.IsTrue(target.GetMappings().Contains(m1)); Assert.IsTrue(target.GetMappings().Contains(m2)); }
public void AddTest() { var m1 = new DelegateMappingInfo <TestClassE, TestClassB>("Prop1", "Prop2", (f, t) => { }); var m2 = new DelegateMappingInfo <TestClassE, TestClassB>("Prop1", "Prop3", (f, t) => { }); var target = new TypeMappingInfo <TestClassE, TestClassB>(); target.Add(m1); target.Add(m2); Assert.IsTrue(target.GetMappings().Contains(m1)); Assert.IsTrue(target.GetMappings().Contains(m2)); }
public void MapTest() { bool executed = false; var target = new DelegateMappingInfo<TestClassC, TestClassD>( "sourceMemberName", "targetMemberName", (f, t) => executed = true); target.Map(new TestClassC(), new TestClassD()); Assert.IsTrue(executed); }
public void MapTest() { bool executed = false; var target = new DelegateMappingInfo <TestClassC, TestClassD>( "sourceMemberName", "targetMemberName", (f, t) => executed = true); target.Map(new TestClassC(), new TestClassD()); Assert.IsTrue(executed); }