diff --git a/csharp/src/Google.Protobuf/ExtensionRegistry.cs b/csharp/src/Google.Protobuf/ExtensionRegistry.cs index 8056304c788d..06701d515251 100644 --- a/csharp/src/Google.Protobuf/ExtensionRegistry.cs +++ b/csharp/src/Google.Protobuf/ExtensionRegistry.cs @@ -85,11 +85,11 @@ public void Add(Extension extension) /// /// Adds the specified extensions to the reigstry /// - public void Add(IEnumerable newExtensions) + public void AddRange(IEnumerable extensions) { - ProtoPreconditions.CheckNotNull(newExtensions, nameof(newExtensions)); + ProtoPreconditions.CheckNotNull(extensions, nameof(extensions)); - foreach (var extension in newExtensions) + foreach (var extension in extensions) Add(extension); } diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index 4c2fe54d560b..9b20e3d22ad6 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -407,7 +407,7 @@ public static FileDescriptor FromGeneratedCode( private static void AddAllExtensions(FileDescriptor[] dependencies, GeneratedClrTypeInfo generatedInfo, ExtensionRegistry registry) { - registry.Add(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray()); + registry.AddRange(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray()); } private static IEnumerable GetAllGeneratedExtensions(GeneratedClrTypeInfo generated)