-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google.Protobuf.WellKnownTypes.Timestamp Error while compiling #718
Comments
|
@stagep Many thanks! |
how to make the same, but with nullable datetime? because using nullable datetime throws the same error which described in topic |
If DateTime is nullable then you have 2 options. Use a nullable Timestamp or create your own gRPC message that can handle the nullability of DateTime with a IsNull property. I use this approach.
nullable_date_time.proto:
and the mapping
|
Thanks for answer.
This code works for me. |
Using GRPC, the proto class that maps to my POCO has one field of type google.protobuf.Timestamp, whereas, it is a datetime field in my poco. The error says "source=Google.Protobuf.WellKnownTypes.Timestamp
destination=System.DateTime" and goes onto say: "Cannot convert immutable type, please consider using 'MapWith' method to create mapping". I assume this means in the configure RegisterMappings method? Can anyone steer me in the right direction to resolve this please? My code is similar to:
TypeAdapterConfig<W1, W2>.NewConfig() .Map(dest => dest.dt, src => src.Dt1)
The text was updated successfully, but these errors were encountered: