app.UseMvc(routes => {
routes.MapRoute("default",
"{controller}/{action}",
new { controller = "Home", action = "Index" });
});
Директива @functions позволяет странице Razor добавлять в представление блок кода C#:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
...
}
Invoke-WebRequest http://yourwebapp/BackgroundTask/Run