Closed urza closed 1 year ago
The Adapt() method is always supposed to return the mapped destination object. This proposal would break that API. It should probably look something like this instead:
sourceObject
.WithIgnore(...)
.Adapt(destObject);
You can probably write that extension method yourself. It just needs to wrap TypeAdapterConfig.NewConfig().Ignore(...) and return the sourceObject afterwards.
@andrerav Thanks, I will try to do that.
Hi, I like the simplicity and minimalist approach of Mapster.
Is it possible to ignore some properties without creating config?
I would imagine something like this:
sourceObject.Adapt(destObject).Ignore("PropertyToIgnore", "AnotherPropertyToIgnore");