Delete unused method and linker suppression (#567)

This commit is contained in:
Stephen Toub 2025-06-28 07:20:34 -04:00 • committed by GitHub
commit 9d835a0625
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,14 +70,6 @@ internal sealed partial class AIFunctionMcpServerTool : McpServerTool
options);
}
// TODO: Fix the need for this suppression.
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111:ReflectionToDynamicallyAccessedMembers",
Justification = "AIFunctionFactory ensures that the Type passed to AIFunctionFactoryOptions.CreateInstance has public constructors preserved")]
internal static Func<Type, AIFunctionArguments, object> GetCreateInstanceFunc() =>
static ([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] type, args) => args.Services is { } services ?
ActivatorUtilities.CreateInstance(services, type) :
Activator.CreateInstance(type)!;
private static AIFunctionFactoryOptions CreateAIFunctionFactoryOptions(
MethodInfo method, McpServerToolCreateOptions? options) =>
new()