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
Currently i should set my [UserMapping] in my partial class
[Mapper]
public partial class ProfileMapper
{
/// <summary> Profile to grpc </summary>
public partial ProfileBase GrpcProfileToProfile(GrpcProfile grpcProfile);
[UserMapping]
private DateTime MapDate(Google.Protobuf.WellKnownTypes.Timestamp date)
=> date?.ToDateTime() ?? new DateTime();
[UserMapping]
private DateTime? MapNullableDate(Google.Protobuf.WellKnownTypes.Timestamp date)
=> date?.ToDateTime();
}
But i want to set this config once, something like :
[Mapper]
public partial class ProfileMapper
{
/// <summary> Profile to grpc </summary>
public partial ProfileBase GrpcProfileToProfile(GrpcProfile grpcProfile);
}
public class GLOBALMapper
{
[UserMapping]
public DateTime MapDate(Google.Protobuf.WellKnownTypes.Timestamp date)
=> date?.ToDateTime() ?? new DateTime();
[UserMapping]
public DateTime? MapNullableDate(Google.Protobuf.WellKnownTypes.Timestamp date)
=> date?.ToDateTime();
}
Do you have some suggestion ?
Have nice day
The text was updated successfully, but these errors were encountered:
Hello every one
Is it possible to define a global configuration ?
I want to convert all
Google.Protobuf.WellKnownTypes.Timestamp
toDateTime
as :Currently i should set my
[UserMapping]
in my partialclass
But i want to set this config once, something like :
Do you have some suggestion ?
Have nice day
The text was updated successfully, but these errors were encountered: