public void Test() { TinyMapper.Bind<Source, Target>(config => config.Bind(from => @from.Campaign, typeof(Campaign1))); var source = new Source { Campaign = new Campaign1 { Value = 1 } }; var result = TinyMapper.Map<Target>(source); }
public void Map_Hierarchy_Success() { TinyMapper.Bind<Source, Target>(); var source = new Source { Id = 1, String = "tiny" }; var actual = TinyMapper.Map<Target>(source); Assert.Equal(source.Id, actual.Id); Assert.Equal(source.String, actual.String); }
public void Test() { var source = new Source { MyInt = 1, MyString = "My Value" }; TinyMapper.Bind<Source, Target>(config => { config.Bind(from => from.MyInt, to => to.Int); config.Bind(from => from.MyString, to => to.MyString); }); var target = TinyMapper.Map<Target>(source); }