Skip to content

Commit 328e478

Browse files
committed
C#: Add ASP.NET Core MapGet routing end point example.
1 parent 4f93f2b commit 328e478

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

csharp/ql/test/library-tests/dataflow/flowsources/aspremote/AspRemoteFlowSource.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Microsoft.AspNetCore.Builder;
12
using Microsoft.AspNetCore.Mvc;
23

34
namespace Testing
@@ -20,4 +21,19 @@ public object MyAction(ViewModel viewModel)
2021
throw null;
2122
}
2223
}
24+
25+
public class AspRoutingEndpoints
26+
{
27+
28+
public void M1(string[] args)
29+
{
30+
var builder = WebApplication.CreateBuilder(args);
31+
var app = builder.Build();
32+
33+
// The delegate parameters are considered flow sources.
34+
app.MapGet("/api/redirect/{newUrl}", (string newUrl) => { });
35+
36+
app.Run();
37+
}
38+
}
2339
}

0 commit comments

Comments
 (0)