Skip to content

Commit 4f150a0

Browse files
committed
💾 Feat(Samples): APIs for StringHelper.cs
1 parent 0913daa commit 4f150a0

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎Common.BasicHelper.Samples/Program.cs‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Common.BasicHelper.Core.Shell;
2+
using Common.BasicHelper.Utils.Extensions;
23
using System.Web;
34

45
var builder = WebApplication.CreateBuilder(args);
@@ -19,13 +20,22 @@
1920

2021
app.UseHttpsRedirection();
2122

22-
app.MapGet("/Core/Shell/CommandsExecutor/{cmd}.{args?}",
23+
app.MapGet("/Utils/Extensions/StringHelper/ExecuteAsCommand/{cmd}.{args?}",
2324
(string cmd, string? args) => cmd.ExecuteAsCommand(
24-
args == "," || args == "{args}" || string.IsNullOrEmpty(args)
25+
args == "," || args == "{args}" || args.IsNullOrWhiteSpace()
2526
? null : HttpUtility.UrlDecode(args)
2627
)
2728
)
28-
.WithName("CommandsExecutor")
29+
.WithName("ExecuteAsCommand")
30+
.WithOpenApi();
31+
32+
app.MapGet("/Utils/Extensions/StringHelper/ExecuteAsCommandAsync/{cmd}.{args?}",
33+
async (string cmd, string? args) => await cmd.ExecuteAsCommandAsync(
34+
args == "," || args == "{args}" || args.IsNullOrWhiteSpace()
35+
? null : HttpUtility.UrlDecode(args)
36+
)
37+
)
38+
.WithName("ExecuteAsCommandAsync")
2939
.WithOpenApi();
3040

3141
app.Run();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Common.BasicHelper.Samples.Utils.Extensions;
2+
3+
public static class StringHelper
4+
{
5+
6+
7+
}

0 commit comments

Comments
 (0)