aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs')
-rwxr-xr-x[-rw-r--r--]csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
index f5798d1e..86942acc 100644..100755
--- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
@@ -34,6 +34,10 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+#if NET35
+// Needed for ReadOnlyDictionary, which does not exist in .NET 3.5
+using Google.Protobuf.Collections;
+#endif
namespace Google.Protobuf.Reflection
{
@@ -102,8 +106,8 @@ namespace Google.Protobuf.Reflection
var map = new Dictionary<string, FieldDescriptor>();
foreach (var field in fields)
{
- map[JsonFormatter.ToCamelCase(field.Name)] = field;
map[field.Name] = field;
+ map[field.JsonName] = field;
}
return new ReadOnlyDictionary<string, FieldDescriptor>(map);
}
@@ -217,6 +221,11 @@ namespace Google.Protobuf.Reflection
File.DescriptorPool.FindSymbol<T>(FullName + "." + name);
/// <summary>
+ /// The (possibly empty) set of custom options for this message.
+ /// </summary>
+ public CustomOptions CustomOptions => Proto.Options?.CustomOptions ?? CustomOptions.Empty;
+
+ /// <summary>
/// Looks up and cross-links all fields and nested types.
/// </summary>
internal void CrossLink()