Mapster icon indicating copy to clipboard operation
Mapster copied to clipboard

Mapping for type

Open angusgajurel opened this issue 2 years ago • 1 comments

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)));

	}
}

angusgajurel avatar Aug 29 '23 15:08 angusgajurel

Hello, your get null or default(decimal)? Please add sample generated code.

DocSvartz avatar Oct 04 '23 08:10 DocSvartz