I have type hierarchy
public class ProvinceInfo
{
public string Code { get; set; }
public string Title { get; set; }
}
class Address
{
public ProvinceInfo Province { get; set; }
}
class AddressState
{
public ProvinceInfo Province { get; set; }
}
and mapster config
...
config
.NewConfig<ProvinceInfo, ProvinceInfo>()
.ShallowCopyForSameType(true);
config
.NewConfig<AddressState, Address>()
.ShallowCopyForSameType(true)
...
when i generate mappers with Mapster.Tool i consistantly receive deep copy:
public AddressState MapTo(Address p1)
...
Province = new ProvinceInfo()
{
Code = p1.Province.Code,
Title = p1.Province.Title
},
...
i neen copy by reference here, but can’t achive it.
By the way, please suggest mapster learning materials. Official docs seems useless.