add RuntimeCompilation
This commit is contained in:
parent
2f83561173
commit
36afbd7837
@ -1,13 +1,18 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnotaryoPH.Data\EnotaryoPH.Data.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\EnotaryoPH.Data\EnotaryoPH.Data.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -16,7 +16,11 @@ namespace EnotaryoPH.Web
|
|||||||
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme,
|
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||||
options => options.LoginPath = new Microsoft.AspNetCore.Http.PathString("/Login"));
|
options => options.LoginPath = new Microsoft.AspNetCore.Http.PathString("/Login"));
|
||||||
builder.Services.AddAuthorization(options => options.AddPolicy("PrincipalPolicy", policy => policy.RequireRole("Principal")));
|
builder.Services.AddAuthorization(options => options.AddPolicy("PrincipalPolicy", policy => policy.RequireRole("Principal")));
|
||||||
builder.Services.AddRazorPages(options => options.Conventions.AuthorizeFolder("/Principal", "PrincipalPolicy"));
|
var razorBuilder = builder.Services.AddRazorPages(options => options.Conventions.AuthorizeFolder("/Principal", "PrincipalPolicy"));
|
||||||
|
#if DEBUG
|
||||||
|
razorBuilder.AddRazorRuntimeCompilation();
|
||||||
|
#endif
|
||||||
|
|
||||||
builder.Services.AddDbContext<NotaryoDBContext>();
|
builder.Services.AddDbContext<NotaryoDBContext>();
|
||||||
builder.Services.AddHttpContextAccessor();
|
builder.Services.AddHttpContextAccessor();
|
||||||
builder.Services.AddSession(options => options.IdleTimeout = TimeSpan.FromMinutes(120));
|
builder.Services.AddSession(options => options.IdleTimeout = TimeSpan.FromMinutes(120));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user