You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the mapper tries to convert the source values to their destination types.
ObjectToObject.cs
usingSystem;usingNUnit.Framework;usingBLToolkit.Mapping;namespaceHowTo.Mapping{[TestFixture]publicclassObjectToObject{publicclassSourceObject{publicboolValue1=true;publicstringValue2="10";publicstringStrValue="test";}publicclassDestObject{[MapField("Value1")]publicboolBoolValue;[MapField("Value2")]publicintIntValue;// If the source and destination field/property names are equal,// there is no need for using the MapField attribute.//publicstringStrValue;}[Test]publicvoidTest1(){SourceObjectsource=newSourceObject();DestObjectdest=Map.ObjectToObject<DestObject>(source);Assert.AreEqual(true,dest.BoolValue);Assert.AreEqual(10,dest.IntValue);Assert.AreEqual("test",dest.StrValue);}}}