diff --git a/fundamentals/minimal-apis/samples/MyAntiForgery/Program.cs b/fundamentals/minimal-apis/samples/MyAntiForgery/Program.cs index d6b1544..bc623bf 100644 --- a/fundamentals/minimal-apis/samples/MyAntiForgery/Program.cs +++ b/fundamentals/minimal-apis/samples/MyAntiForgery/Program.cs @@ -1,3 +1,6 @@ +#define SHORT // FIRST SHORT +#if NEVER +#elif FIRST // using Microsoft.AspNetCore.Antiforgery; using Microsoft.AspNetCore.Mvc; @@ -71,3 +74,20 @@ public static class MyHtml // } // +#elif 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!"); +// +#endif