From 606cb7ed2c55d5bda8aad2c88e5b0af09230fb3b Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Tue, 28 Feb 2017 10:51:19 -0800 Subject: There might be duplicated enum values when allow_alias is true. Add PreferredAlias into OriginalNameAttribute to remove the duplication (#2727) --- csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs') diff --git a/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs b/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs index 27f9ab98..07d0fd99 100644 --- a/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs +++ b/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs @@ -46,6 +46,11 @@ namespace Google.Protobuf.Reflection /// public string Name { get; set; } + /// + /// If the name is preferred in the .proto file. + /// + public bool PreferredAlias { get; set; } + /// /// Constructs a new attribute instance for the given name. /// @@ -53,6 +58,8 @@ namespace Google.Protobuf.Reflection public OriginalNameAttribute(string name) { Name = ProtoPreconditions.CheckNotNull(name, nameof(name)); + PreferredAlias = true; } + } -} \ No newline at end of file +} -- cgit v1.2.3