When to use Map and MapWhen branch in asp.net core middleware while we are authenticating request.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.Map("", (appBuilder) =>
{
appBuilder.Run(async (context) => {
await context.Response.WriteAsync("");
});
});
app.MapWhen(context => context.Request.Query.ContainsKey(""), (appBuilder) =>
{
appBuilder.Run(async (context) =>
{
await context.Response.WriteAsync("");
});
});
}