-
Notifications
You must be signed in to change notification settings - Fork 120
Feature request: mapping for get only lists #112
Comments
Right now it's impossible without huge redesign. Mappings for methods with signature |
@cezarypiatek I can make a pull request of my code (wip), this already generates the above code without breaking any other tests. |
cool, please do that, I will take a look at that |
@cezarypiatek can you check if the following syntax works correctly? At least it doesn't give me any syntax errors: public virtual Hello3 MapHello3(Hello hello)
{
return new GrpcService1.Hello3()
{
Message = hello.Message,
Names = {
hello.Names
}
};
} UPDATE: I've tested it by myself and it's working. I think Mapping Generator should implement this syntax for collection without setters. I think there is a similar problem for other properties (complex object) without setters. UPDATE: This kind of assignment is valid for types that implement |
Could we add a mapping option for get only lists?
It is useful for when an object is doing the list initialization themself and only exposing a getter for the list.
In my case, I am using protobuf/grpc which generates types with only a getter for the list. And filling the list should be done with Add/Addrange, it would be nice if the mapping for this can be generated.
e.g. the following objects
current generated result
would like to have the following code generated
The text was updated successfully, but these errors were encountered: