From 16a3e2b91423c32680b3dc904c839853c9dc8cc8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 13 Apr 2015 13:03:23 -0700 Subject: [PATCH] enable overriding of property name using csharp_property_name --- src/google/protobuf/compiler/csharp/csharp_helpers.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.cc b/src/google/protobuf/compiler/csharp/csharp_helpers.cc index ac258f04c4..55ce3285e6 100644 --- a/src/google/protobuf/compiler/csharp/csharp_helpers.cc +++ b/src/google/protobuf/compiler/csharp/csharp_helpers.cc @@ -253,7 +253,9 @@ std::string GetFieldConstantName(const FieldDescriptor* field) { } std::string GetPropertyName(const FieldDescriptor* descriptor) { - // TODO: fix this. + if (descriptor->options().has_csharp_property_name()) { + return descriptor->options().csharp_property_name(); + } std::string property_name = UnderscoresToPascalCase(GetFieldName(descriptor)); if (property_name == descriptor->containing_type()->name()) { property_name += "_";