Mapster
Mapster copied to clipboard
Mapping for type
I am using code generation using mapster tool, but looks like this is not supported, Can someone help
//for every string property you find in the source object, use the following logic to convert it to a decimal? in the destination object
public class PhenxMapperConfig : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.NewConfig<PureRegressionApplicantRequestDataDto, PhenxFISDataDto>()
.Fork(config => config.ForType<string, decimal?>().MapWith(str => string.IsNullOrEmpty(str) ? null : decimal.Parse(str)));
}
}
Hello, your get null or default(decimal)? Please add sample generated code.