Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make IDiagnosticExtensions internal and fix namespace #2053

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}
}
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
Loading