beantownace
Active member
- Joined
- Feb 15, 2019
- Messages
- 41
- Programming Experience
- 5-10
Hello all,
I need some intel and hoping someone may be able to help where I have some strings coming in via JSON this may be easy and not thinking about it right. I have a single enum that I am parsing fine where I do a:
I then have a collection of enums where I am having some trouble how to parse it with strings with this Google Protobuf Collection. Here is what it has now without the strings.
I need to pass this with strings so the enum values are as follows:
Any idea how to send this via JSON value it would be key
and how I can parse that to the enum collection.
Thanks all really appreciate any help hope this makes sense.
I need some intel and hoping someone may be able to help where I have some strings coming in via JSON this may be easy and not thinking about it right. I have a single enum that I am parsing fine where I do a:
C#:
Enum.Parse<CustomerGroup>("GroupA") //GroupA coming in a string via JSON this works well.
C#:
Google.Protobuf.Collections.RepeatedField<CustomerOperation> customerOperations = { CustomerOperation.CreateCustomer, CustomerOperation.CreateCustomerGroup };
C#:
CustomerOperation.CreateCustomer = "CREATE_CUSTOMER"
CustomerOperation.CreateCustomerGroup = "CREATE_CUSTOMER_GROUP"
"customerOperations" : [something here]
and how I can parse that to the enum collection.
Thanks all really appreciate any help hope this makes sense.
Last edited by a moderator: