diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Startup.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Startup.cs index 3b7a242e38..a3f05bd3fd 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Startup.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Startup.cs @@ -52,7 +52,6 @@ namespace Company.WebApplication1 // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - #if (IndividualLocalAuth) services.AddDbContext(options => #if (UseLocalDB) @@ -108,8 +107,8 @@ namespace Company.WebApplication1 services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme) .AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options)); #endif - #if (OrganizationalAuth) + services.AddRazorPages().AddMvcOptions(options => { var policy = new AuthorizationPolicyBuilder() diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs index 915e26d1b1..148b3b4bc4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs @@ -52,7 +52,6 @@ namespace Company.WebApplication1 // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - #if (IndividualLocalAuth) services.AddDbContext(options => #if (UseLocalDB) @@ -108,8 +107,8 @@ namespace Company.WebApplication1 services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme) .AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options)); #endif - #if (OrganizationalAuth) + services.AddControllersWithViews(options => { var policy = new AuthorizationPolicyBuilder()