-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (20 loc) · 830 Bytes
/
Program.cs
File metadata and controls
29 lines (20 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using FeRazorApp.Data;
using FeRazorApp.Model;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();//.AddRazorRuntimeCompilation();//
builder.Services.AddDbContext<ApplicationDbContext>(option=>option.UseSqlServer(
builder.Configuration.GetConnectionString("DefaultConnection")
));
builder.Services.AddDbContext<AuthDbContext>(option => option.UseSqlServer(
builder.Configuration.GetConnectionString("DefaultConnection")
));
builder.Services.AddIdentity<IdentityUser, IdentityRole>().AddEntityFrameworkStores<AuthDbContext>();
var app = builder.Build();
app.UseHttpsRedirection();//
app.UseStaticFiles();//apontaoroot~
app.UseRouting();//
app.MapRazorPages();//
app.Run();
app.UseAuthentication();