Update templates to use endpoint routing (#4500)
This commit is contained in:
parent
c6fa808a91
commit
0c9eda1f4a
|
|
@ -25,9 +25,12 @@ namespace Company.WebApplication1
|
|||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.Run(async (context) =>
|
||||
app.UseRouting(routes =>
|
||||
{
|
||||
await context.Response.WriteAsync("Hello World!");
|
||||
routes.MapGet("/", async context =>
|
||||
{
|
||||
await context.Response.WriteAsync("Hello World!");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,6 @@ type Startup() =
|
|||
if env.IsDevelopment() then
|
||||
app.UseDeveloperExceptionPage() |> ignore
|
||||
|
||||
app.Run(fun context -> context.Response.WriteAsync("Hello World!")) |> ignore
|
||||
app.UseRouting(fun routing ->
|
||||
routing.MapGet("/", fun context -> context.Response.WriteAsync("Hello World!")) |> ignore
|
||||
) |> ignore
|
||||
|
|
@ -155,13 +155,18 @@ namespace Company.WebApplication1
|
|||
|
||||
#endif
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting(routes =>
|
||||
{
|
||||
routes.MapApplication();
|
||||
});
|
||||
|
||||
app.UseCookiePolicy();
|
||||
|
||||
#if (OrganizationalAuth || IndividualAuth)
|
||||
app.UseAuthentication();
|
||||
|
||||
#endif
|
||||
app.UseMvc();
|
||||
app.UseAuthorization();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,18 +154,21 @@ namespace Company.WebApplication1
|
|||
|
||||
#endif
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting(routes =>
|
||||
{
|
||||
routes.MapApplication();
|
||||
routes.MapControllerRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
|
||||
app.UseCookiePolicy();
|
||||
|
||||
#if (OrganizationalAuth || IndividualAuth)
|
||||
app.UseAuthentication();
|
||||
|
||||
#endif
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
app.UseAuthorization();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,13 @@ type Startup private () =
|
|||
#endif
|
||||
app.UseStaticFiles() |> ignore
|
||||
|
||||
app.UseMvc(fun routes ->
|
||||
routes.MapRoute(
|
||||
app.UseRouting(fun routes ->
|
||||
routes.MapApplication() |> ignore
|
||||
routes.MapControllerRoute(
|
||||
name = "default",
|
||||
template = "{controller=Home}/{action=Index}/{id?}") |> ignore
|
||||
) |> ignore
|
||||
|
||||
app.UseAuthorization() |> ignore
|
||||
|
||||
member val Configuration : IConfiguration = null with get, set
|
||||
|
|
|
|||
|
|
@ -61,13 +61,17 @@ namespace Company.WebApplication1
|
|||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
app.UseRouting(routes =>
|
||||
{
|
||||
routes.MapApplication();
|
||||
});
|
||||
|
||||
#if (OrganizationalAuth || IndividualAuth)
|
||||
app.UseAuthentication();
|
||||
#endif
|
||||
app.UseMvc();
|
||||
app.UseAuthorization();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ type Startup private () =
|
|||
#else
|
||||
|
||||
#endif
|
||||
app.UseMvc() |> ignore
|
||||
app.UseRouting(fun routes ->
|
||||
routes.MapApplication() |> ignore
|
||||
) |> ignore
|
||||
|
||||
app.UseAuthorization() |> ignore
|
||||
|
||||
member val Configuration : IConfiguration = null with get, set
|
||||
|
|
|
|||
Loading…
Reference in New Issue