Skip to content

Commit

Permalink
make IDiagnosticExtensions internal and fix namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mus65 committed Jan 10, 2025
1 parent d4e155b commit d405592
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
30 changes: 15 additions & 15 deletions src/Microsoft.OpenApi/Reader/OpenApiDiagnostic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ public void AppendDiagnostic(OpenApiDiagnostic diagnosticToAdd, string fileNameT
}
}
}
}

/// <summary>
/// Extension class for IList to add the Method "AddRange" used above
/// </summary>
public static class IDiagnosticExtensions
{
/// <summary>
/// Extension method for IList so that another list can be added to the current list.
/// Extension class for IList to add the Method "AddRange" used above
/// </summary>
/// <param name="collection"></param>
/// <param name="enumerable"></param>
/// <typeparam name="T"></typeparam>
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> enumerable)
internal static class IDiagnosticExtensions
{
if (collection is null || enumerable is null) return;

foreach (var cur in enumerable)
/// <summary>
/// Extension method for IList so that another list can be added to the current list.
/// </summary>
/// <param name="collection"></param>
/// <param name="enumerable"></param>
/// <typeparam name="T"></typeparam>
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> enumerable)
{
collection.Add(cur);
if (collection is null || enumerable is null) return;

foreach (var cur in enumerable)
{
collection.Add(cur);
}
}
}
}
4 changes: 0 additions & 4 deletions test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Readers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")]
public static class IDiagnosticExtensions
{
public static void AddRange<T>(this System.Collections.Generic.ICollection<T> collection, System.Collections.Generic.IEnumerable<T> enumerable) { }
}
namespace Microsoft.OpenApi.Any
{
public class OpenApiAny : Microsoft.OpenApi.Interfaces.IOpenApiElement, Microsoft.OpenApi.Interfaces.IOpenApiExtension
Expand Down

0 comments on commit d405592

Please sign in to comment.