Design the App Architecture Flashcards

1
Q

app.UseStaticFiles()

A

Startup.cs - defaults to serving files from the wwwroot folder by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

app.UseDefaultFiles()

A

look for blank directory URL as a file and changes the app to understand as file references (not required if MVC is enabled)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

app.UseDeveloperExceptionPage()

A

Startup.cs - want to support pages being shown when exceptions are thrown, not “file not found”, and present the actual stack trace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

services.AddTransient

A

startup.cs - service that is kept for the length of the request (no data associated, mostly helper functions)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

services.AddScoped

A

startup.cs - service that is kept for the length of a connection (database oriented work)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

services.AddSingleton

A

startup.cs - services that are created once and used for lifetime of web app

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

steps for adding a service

A
1 create the class
2 extract / create the interface
3 load the service in startup.cs
4 pass into the given controller / model
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

dotnet ef database update

A

run initialization command to setup database to use EF (only provisions the migrationsHistory table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

dotnet ef migrations add

A

Looks at the data stores we have and adds code that lets us go from current DB state to new DB state (DOES NOT ACTUALLY PROVISION TABLES)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

_ctx.SaveChanges()

A

returns the number of rows affected / that are different from the DB state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

[Authorize]

A

Route parameter that says that some type of authorization has to happen to navigate there

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

services.AddIdentity<a></a>

A

startup.cs configure identity for given class (A) and provide it an instance of the IdentityRole (B)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

.AddEntityFrameworkStores<a>();</a>

A

Letting EF know what type of context to use (A) for when EF wants to access data in the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

app.UseAuthentication();

A

startup - configure() - tells the app that we want to use authentication and use any config done in config services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

signInManager.PasswordSignInAsync

A

attempts to sign in using the username and password instead of having to go and get the stored object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly