From 44841bede9bf0686ca28fb3082d503e745976e41 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Sat, 23 Mar 2024 18:41:33 +0100 Subject: [PATCH] feat: extract static array to readonly field --- sample/src/Demo.Api/Extensions/WebApplicationExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sample/src/Demo.Api/Extensions/WebApplicationExtensions.cs b/sample/src/Demo.Api/Extensions/WebApplicationExtensions.cs index e31c47b..6096c48 100644 --- a/sample/src/Demo.Api/Extensions/WebApplicationExtensions.cs +++ b/sample/src/Demo.Api/Extensions/WebApplicationExtensions.cs @@ -3,13 +3,15 @@ namespace Demo.Api.Extensions; public static class WebApplicationExtensions { + private static readonly string[] PatchHttpMethods = { "patch" }; + public static RouteHandlerBuilder MapPatch( this WebApplication app, string pattern, Delegate handler) => app.MapMethods( pattern, - new[] { "patch" }, + PatchHttpMethods, handler); public static IApplicationBuilder AddGlobalErrorHandler(