Open rm-code opened 1 year ago
Possible duplicate of #537
Hello, The collection adapter does not interact with elements of the collection TDistination Its logic For is approximately as follows:
var _result = new Collection<TDistination>();
foreach (var item in Collection<TSourse>)
{
_result.Add(item.Adapt<TDistination>());
}
return _result;
You converted NestedCollectionDto => NestedCollectionEntity
Since the specified fields with such names in "CreatedOn" "CreatedBy" in NestedCollectionDto was not found in them they were assigned default values
Hello, looks like you wanted to get .unionby() or .intersectby() between List Tsource and List TDistination ?
Let's say I have a situation where an incoming collections needs to be mapped onto an existing collection.
src.Adapt(dest)
doesn't produce the intended outcome since (I assume) Mapster doesn't know how to match the items in the collection.The output this produces looks like this:
Is there an easy way to set this up via Mapster?
My current workaround is to write my own "matching logic":