Open wangx036 opened 1 week ago
If you want non standard mapping just create a config for your types. Or use [AdaptIgnore] on 'Id' field if you can decorate your class with attributes. It is your custom logic. Why would you want Mapster handle this for you?
For example, in the following code, when
objSource.Adapt<DestClass>()
is executed, an exception will be thrown. Can we ignore this exception and setobjDest.Id = default(int)
to obtainobjDest
as{Id=0,Name="TestName"}
?