Skip to content

Commit 5d207fb

Browse files
committed
Rename web api extension methods
1 parent 7f3ac48 commit 5d207fb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

AssetRipper.NativeDialogs.WebApi/Program.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public static void Main(string[] args)
1515

1616
WebApplication app = builder.Build();
1717

18-
app.MapGet("/", () => Task.FromResult<string?>("Welcome to the AssetRipper Native Dialogs Web API!"));
19-
app.MapGet("/open-file", OpenFileDialog.OpenFile);
20-
app.MapGet("/open-files", OpenFileDialog.OpenFiles);
21-
app.MapGet("/open-folder", OpenFolderDialog.OpenFolder);
22-
app.MapGet("/open-folders", OpenFolderDialog.OpenFolders);
23-
app.MapGet("/save-file", SaveFileDialog.SaveFile);
24-
app.MapGet("/confirm", static async Task<string?> () =>
18+
app.MapGetFunction("/", () => Task.FromResult<string?>("Welcome to the AssetRipper Native Dialogs Web API!"));
19+
app.MapGetFunction("/open-file", OpenFileDialog.OpenFile);
20+
app.MapGetFunction("/open-files", OpenFileDialog.OpenFiles);
21+
app.MapGetFunction("/open-folder", OpenFolderDialog.OpenFolder);
22+
app.MapGetFunction("/open-folders", OpenFolderDialog.OpenFolders);
23+
app.MapGetFunction("/save-file", SaveFileDialog.SaveFile);
24+
app.MapGetFunction("/confirm", static async Task<string?> () =>
2525
{
2626
bool? result = await ConfirmationDialog.Confirm(new() { Message = "Do you acknowledge?", Type = ConfirmationDialog.Type.YesNo });
2727
return result switch
@@ -31,7 +31,7 @@ public static void Main(string[] args)
3131
null => "User canceled the dialog."
3232
};
3333
});
34-
app.MapGet("/message", static async Task<string?> () =>
34+
app.MapGetFunction("/message", static async Task<string?> () =>
3535
{
3636
await MessageDialog.Message("Hello, World!");
3737
return "Message dialog shown.";
@@ -45,7 +45,7 @@ private static void DisableCaching(this HttpResponse response)
4545
response.Headers.CacheControl = "no-store, max-age=0";
4646
}
4747

48-
private static void MapGet(this WebApplication app, [StringSyntax("Route")] string path, Func<Task<string?>> func)
48+
private static void MapGetFunction(this WebApplication app, [StringSyntax("Route")] string path, Func<Task<string?>> func)
4949
{
5050
app.MapGet(path, async (context) =>
5151
{
@@ -54,7 +54,7 @@ private static void MapGet(this WebApplication app, [StringSyntax("Route")] stri
5454
});
5555
}
5656

57-
private static void MapGet(this WebApplication app, [StringSyntax("Route")] string path, Func<Task<string[]?>> func)
57+
private static void MapGetFunction(this WebApplication app, [StringSyntax("Route")] string path, Func<Task<string[]?>> func)
5858
{
5959
app.MapGet(path, async (context) =>
6060
{

0 commit comments

Comments
 (0)