.NET How to extract original name for the enum from OriginalNameAttribute

274 views
Skip to first unread message

marspox

unread,
Apr 28, 2023, 7:04:18 AM4/28/23
to Protocol Buffers
Hi,
In proto file I have defined:

enum MyEnum{
 THIS_IS_VAL_1 = 0,
 THIS_IS_VAL_2 = 1
}

Then in my c# client I see enum like:

enum MyEnum{
[pbr::OriginalName("THIS_IS_VAL_1 ")] ThisIsVal1= 0,
[pbr::OriginalName("THIS_IS_VAL_2 ")] ThisIsVal2= 1
}

Questions, is there any mechanism provided by Proto to extract the original name or shall I use a reflection to extract attribute value?

Thank you in advance for any hints.
Reply all
Reply to author
Forward
0 new messages