-
-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem? Please describe.
Many objects provide static methods instead of constructors for semantic reasons. Unfortunately as Mapperly is unable to use them users have to manually provide wrapper methods. Based upon.
Solution
Mapperly should look for static methods that meet the following criteria:
- static methods on the target type named From{SourceType.Name} accepting the source type as a single parameter and the target type as return type
- static methods on the source type named To{TargetType.Name} accepting the source type as single parameter returning the target type
Implementation
- This should be used as a fallback for if there are no compatible constructors. Should look for the target types
Frommethods before looking for the sourceTomethods. - Perhaps the sources
Tomethods could include non static methods.
var target = new global::Mapperly_gRPC.HelloReply();
target.Message = response.Message;
target.ResponseTime = Timestamp.FromDateTimeOffset(response.ResponseTime);
return target;See #1107.
cremor, latonz and IanKemp
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers