Skip to content

Commit d405592

Browse files
committed
make IDiagnosticExtensions internal and fix namespace
1 parent d4e155b commit d405592

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

src/Microsoft.OpenApi/Reader/OpenApiDiagnostic.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,26 @@ public void AppendDiagnostic(OpenApiDiagnostic diagnosticToAdd, string fileNameT
4848
}
4949
}
5050
}
51-
}
5251

53-
/// <summary>
54-
/// Extension class for IList to add the Method "AddRange" used above
55-
/// </summary>
56-
public static class IDiagnosticExtensions
57-
{
5852
/// <summary>
59-
/// Extension method for IList so that another list can be added to the current list.
53+
/// Extension class for IList to add the Method "AddRange" used above
6054
/// </summary>
61-
/// <param name="collection"></param>
62-
/// <param name="enumerable"></param>
63-
/// <typeparam name="T"></typeparam>
64-
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> enumerable)
55+
internal static class IDiagnosticExtensions
6556
{
66-
if (collection is null || enumerable is null) return;
67-
68-
foreach (var cur in enumerable)
57+
/// <summary>
58+
/// Extension method for IList so that another list can be added to the current list.
59+
/// </summary>
60+
/// <param name="collection"></param>
61+
/// <param name="enumerable"></param>
62+
/// <typeparam name="T"></typeparam>
63+
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> enumerable)
6964
{
70-
collection.Add(cur);
65+
if (collection is null || enumerable is null) return;
66+
67+
foreach (var cur in enumerable)
68+
{
69+
collection.Add(cur);
70+
}
7171
}
7272
}
7373
}

test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Readers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
33
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
44
[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")]
5-
public static class IDiagnosticExtensions
6-
{
7-
public static void AddRange<T>(this System.Collections.Generic.ICollection<T> collection, System.Collections.Generic.IEnumerable<T> enumerable) { }
8-
}
95
namespace Microsoft.OpenApi.Any
106
{
117
public class OpenApiAny : Microsoft.OpenApi.Interfaces.IOpenApiElement, Microsoft.OpenApi.Interfaces.IOpenApiExtension

0 commit comments

Comments
 (0)