Mapster icon indicating copy to clipboard operation
Mapster copied to clipboard

Int64.IConvertible.ToDateTime (IFormatProvider) was called # InvalidCastException

Open JeffCaptain opened this issue 4 years ago • 1 comments

class Parent { public DateTime Time {get;set;} } class Child:Parent { public new long Time {get;set;} } // *** config.ForType<Parent, Child>() .Map(desc => desc.Time ,src => 1630985699000)

The above exception is thrown during mapping : InvalidCastException

JeffCaptain avatar Sep 07 '21 03:09 JeffCaptain

@jeffcaper This is a strange design, in my opinion. Is there no way for you to work around this in your application?

andrerav avatar Feb 19 '22 13:02 andrerav