File tree 4 files changed +20
-16
lines changed
src/ProjectTemplates/Web.ProjectTemplates/content
ComponentsWebAssembly-CSharp/Server 4 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 46
46
47
47
// Add services to the container.
48
48
#if ( IndividualLocalAuth )
49
+ var connectionString = builder . Configuration . GetConnectionString ( "DefaultConnection" ) ;
49
50
builder . Services . AddDbContext < ApplicationDbContext > ( options =>
50
51
#if ( UseLocalDB )
51
- options . UseSqlServer (
52
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
52
+ options . UseSqlServer ( connectionString ) ) ;
53
53
#else
54
- options . UseSqlite (
55
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
54
+ options . UseSqlite ( connectionString ) ) ;
56
55
#endif
57
56
builder . Services . AddDatabaseDeveloperPageExceptionFilter ( ) ;
58
57
builder . Services . AddDefaultIdentity < IdentityUser > ( options => options . SignIn . RequireConfirmedAccount = true )
140
139
141
140
app . UseStaticFiles ( ) ;
142
141
142
+ app . UseRouting ( ) ;
143
+
143
144
#if ( OrganizationalAuth || IndividualAuth )
144
145
app . UseAuthentication ( ) ;
145
146
app . UseAuthorization ( ) ;
Original file line number Diff line number Diff line change 29
29
30
30
// Add services to the container.
31
31
#if ( IndividualLocalAuth )
32
+ var connectionString = builder . Configuration . GetConnectionString ( "DefaultConnection" ) ;
32
33
builder . Services . AddDbContext < ApplicationDbContext > ( options =>
33
34
#if ( UseLocalDB )
34
- options . UseSqlServer (
35
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
35
+ options . UseSqlServer ( connectionString ) ) ;
36
36
#else
37
- options . UseSqlite (
38
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
37
+ options . UseSqlite ( connectionString ) ) ;
39
38
#endif
40
39
builder . Services . AddDatabaseDeveloperPageExceptionFilter ( ) ;
41
40
106
105
app . UseBlazorFrameworkFiles ( ) ;
107
106
app . UseStaticFiles ( ) ;
108
107
108
+ app . UseRouting ( ) ;
109
+
109
110
#if ( IndividualLocalAuth )
110
111
app . UseIdentityServer ( ) ;
111
112
#endif
Original file line number Diff line number Diff line change 38
38
39
39
// Add services to the container.
40
40
#if ( IndividualLocalAuth )
41
+ var connectionString = builder . Configuration . GetConnectionString ( "DefaultConnection" ) ;
41
42
builder . Services . AddDbContext < ApplicationDbContext > ( options =>
42
43
#if ( UseLocalDB )
43
- options . UseSqlServer (
44
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
44
+ options . UseSqlServer ( connectionString ) ) ;
45
45
#else
46
- options . UseSqlite (
47
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
46
+ options . UseSqlite ( connectionString ) ) ;
48
47
#endif
49
48
builder . Services . AddDatabaseDeveloperPageExceptionFilter ( ) ;
50
49
124
123
#endif
125
124
app . UseStaticFiles ( ) ;
126
125
126
+ app . UseRouting ( ) ;
127
+
127
128
#if ( OrganizationalAuth || IndividualAuth )
128
129
app . UseAuthentication ( ) ;
129
130
#endif
Original file line number Diff line number Diff line change 38
38
39
39
// Add services to the container.
40
40
#if ( IndividualLocalAuth )
41
+ var connectionString = builder . Configuration . GetConnectionString ( "DefaultConnection" ) ;
41
42
builder . Services . AddDbContext < ApplicationDbContext > ( options =>
42
43
#if ( UseLocalDB )
43
- options . UseSqlServer (
44
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
44
+ options . UseSqlServer ( connectionString ) ) ;
45
45
#else
46
- options . UseSqlite (
47
- builder . Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
46
+ options . UseSqlite ( connectionString ) ) ;
48
47
#endif
49
48
builder . Services . AddDatabaseDeveloperPageExceptionFilter ( ) ;
50
49
125
124
#endif
126
125
app . UseStaticFiles ( ) ;
127
126
127
+ app . UseRouting ( ) ;
128
+
128
129
#if ( OrganizationalAuth || IndividualAuth )
129
130
app . UseAuthentication ( ) ;
130
131
#endif
You can’t perform that action at this time.
0 commit comments