Skip to content

Commit

Permalink
feat: extract static array to readonly field
Browse files Browse the repository at this point in the history
  • Loading branch information
perkops committed Mar 23, 2024
1 parent 6d2a8ee commit 44841be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sample/src/Demo.Api/Extensions/WebApplicationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 44841be

Please sign in to comment.