You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create a profile by using function createMap(), and i need to convert some field has type Date to string. Now, I want to when i receive data from client using reverseMap() with convert again string to Date. Pls help me provide some example. Thanks
The text was updated successfully, but these errors were encountered:
When working with Date Time, it's quite tricky because AutoMapper cannot determine how you want to convert a Date to a string (https://automapper.netlify.app/docs/usages/features/date-time). When you have a conversion from Date <-> string, it's best to use mapFrom() to handle these cases.
exportclassStringDateConverterextendsConverter<string,Date>{convert(source: string): Date{// maybe run your validation on the date stringreturnnewDate(source);}}exportclassDateStringConverterextendsConverter<Date,string>{convert(source: Date): string{returnsource.toDateString();}}
I create a profile by using function createMap(), and i need to convert some field has type Date to string. Now, I want to when i receive data from client using reverseMap() with convert again string to Date. Pls help me provide some example. Thanks
The text was updated successfully, but these errors were encountered: