pull/178/head
Rick Anderson 2023-08-24 15:41:41 -10:00 committed by GitHub
parent 0378d95fe7
commit 1819f96226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,6 @@
#define SHORT // FIRST SHORT
#if NEVER
#elif FIRST
// <snippet_all>
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Mvc;
@ -71,3 +74,20 @@ public static class MyHtml
// </snippet_html>
}
// </snippet_all>
#elif SHORT
// <snippet_short>
using Microsoft.AspNetCore.Antiforgery;
var builder = WebApplication.CreateBuilder();
builder.Services.AddAntiforgery();
var app = builder.Build();
// Implicitly added by WebApplicationBuilder
// app.UseAntiforgery();
app.Run();
app.MapGet("/", () => "Hello World!");
// </snippet_short>
#endif