INFO 3067 Midterm Flashcards

(67 cards)

1
Q

What is the default method for controllers?

A

Index

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

What file is the connection string located?

A

appsettings.json

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

What is the DAL?

A

Data Access Layer

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

What 2 folders are held in the DAL?

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

What are the 4 steps in the “code-first” approach?

A
  1. Create Domain Classes
  2. Add class to the DbContext class
  3. add-migration
  4. update-database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What annotations are used to represent a primary key?

A

[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]

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

What annotations are used to set up a foreign key?

A

[ForeignKey(“FieldName”)]
public Foreign? Foreign { get; set; }

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

What is the DbContext class?

A

Represents a session with the database

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

Where is the DbContext class found?

A

DAL

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

How do you add an entity to the DbContext class?

A

public virtual DbSet< Entity >? Entity { get; set; }

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

What does the middleware do?

A

Controls how the application responds to HTTP requests

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

What file houses the middleware?

A

Program.cs

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

What 2 keywords are used for asynchronous programming?

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

What 3 things are required in an asynchronous method definition?

A
  1. async
  2. Task< return type >
  3. method name ends with “Async()”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What kind of methods are defined by a controller?

A

Action Methods

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

What must a controller class name end with?

A

“Controller”

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

What is the return type of controller methods?

A

IActionResult

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

What is the keyword dynamic used for?

A

Variable’s type can change or is unknown until runtime

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

What is .RemoveRange method?

A

Removes rows from the database when called on a DbContext object

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

What does the .Distinct method return?

A

IEnumerable collection

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

What makes the AppDbContext available to the controller?

A

Middleware via dependency injection

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

What is needed to install Vue?

A

Node.js, only for the npm

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

What is npm?

A

Node Package Manager

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

What are the 3 parts of a route in Vue?

A
  1. path
  2. name
  3. component
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you start up the development server for quasar?
npx quasar dev
26
What does the layout do?
Shares a common look and feel between pages
27
Where does the page get rendered in the layout?
router-view
28
How do you signify a Quasar component?
q-
29
What is @click called?
A directive
30
What is the reactive hook method used for?
Contains state variables
31
How do you get the reactive method?
Import from "vue"
32
What are all the methods contained in in the script part of a vue page?
export default { setup() { } }
33
What is the final part of the script portion of a vue page?
return { methods }
34
The use of setup() and reactive in vue is called what?
Composition API
35
What middleware has to be added to allow for Cross Origin calls?
builder.Services.AddCors...
36
What is a Cross Origin error?
When one server is trying to make a call on another server that doesn't allow it
37
What is "v-if"
Vue directive, an if statement
38
What function is used to add a "life cycle event"?
onMounted
39
What is a "v-model"?
Vue attribute that binds control to a variable
40
What does "@update-model-value" do?
Points to a handler when control value changes
41
What is added to the q-select component to display a name instead of an id?
map-options
42
What component houses the pop-up when a product/sandwich is selected?
q-dialog
43
To change the theme, which file needs to be updated in Vue?
css\quasar.variables.scss
44
What is the component for a menu?
q-menu
45
How do you specify that a button in the menu changes the screen?
to="\"
46
What function is used in the script to use the router?
useRouter
47
How do you get the function for routers in Vue?
import { useRouter } from "vue-router";
48
What function is used on a router object to change to another page?
push router.push("tray");
49
What framework is provided by Microsoft for password hashing?
Identity Framework
50
What are the 2 components of our customer logic?
1. Hashed passwords + SALT 2. JSON Web Tokens
51
What is a JWT?
JSON Web Token
52
What is hashing?
Scrambling a password using some kind of key
53
What is SHA-2?
Secure Hash Algorithm
54
What is salting?
A layer of defense from hackers brute-force finding common passwords.
55
Where are JSON Web Tokens stored?
HTTP Headers
56
What is added to middleware to allow for JWT?
Authentication Scheme
57
Where is the secret string for generating tokens kept?
appsettings.json
58
What HTTP method is used when registering or logging into an account?
[HttpPost]
59
What is added to the UserController to allow for JWT creation?
IConfiguration configuration
60
What does the IConfiguration allow the login function to do?
Read the secret string in settings
61
What are the 3 arguments for the VerifyPassword method?
1. Entered Password 2. Hash from db 3. Salt from db
62
What attribute is added to the class level of the controllers to force a user to be logged in?
[Authorize]
63
What attribute was added to the register and login controller methods to not require being logged in?
[AllowAnonymous]
64
What is added to the headers to allow for the token?
Authorization, Bearer + token
65
What are the 2 main benefits of the "using" statement in C#?
1. Helps garbage collection via Dispose() 2. Returns connection to the connection pool
66
What function was called on the DbContext object to begin a transaction?
BeginTransactionAsync()
67
What 2 functions were used while adding rows to the database?
1. AddAsync() 2. SaveChangesAsync()