public void Map() { TypeAdapterConfig.GlobalSettings.Clear(); TypeAdapterConfig.GlobalSettings.NewConfig <SourceClass, DestClass>() .IgnoreNullValues(true) .Compile(); var source = new SourceClass(); var dest = source.Adapt <DestClass>(); Assert.AreEqual("Hello", dest.Title); Assert.IsNotNull(dest.Sub); Assert.IsNotNull(dest.List); }
public void Map() { TypeAdapterConfig.GlobalSettings.Clear(); TypeAdapterConfig.GlobalSettings.NewConfig<SourceClass, DestClass>() .IgnoreNullValues(true) .Compile(); var source = new SourceClass(); var dest = source.Adapt<DestClass>(); Assert.AreEqual("Hello", dest.Title); Assert.NotNull(dest.Sub); Assert.NotNull(dest.List); }