INFO 3067 Midterm Flashcards

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
Q

How do you start up the development server for quasar?

A

npx quasar dev

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

What does the layout do?

A

Shares a common look and feel between pages

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

Where does the page get rendered in the layout?

A

router-view

28
Q

How do you signify a Quasar component?

A

q-

29
Q

What is @click called?

A

A directive

30
Q

What is the reactive hook method used for?

A

Contains state variables

31
Q

How do you get the reactive method?

A

Import from “vue”

32
Q

What are all the methods contained in in the script part of a vue page?

A

export default {
setup() {
}
}

33
Q

What is the final part of the script portion of a vue page?

A

return { methods }

34
Q

The use of setup() and reactive in vue is called what?

A

Composition API

35
Q

What middleware has to be added to allow for Cross Origin calls?

A

builder.Services.AddCors…

36
Q

What is a Cross Origin error?

A

When one server is trying to make a call on another server that doesn’t allow it

37
Q

What is “v-if”

A

Vue directive, an if statement

38
Q

What function is used to add a “life cycle event”?

A

onMounted

39
Q

What is a “v-model”?

A

Vue attribute that binds control to a variable

40
Q

What does “@update-model-value” do?

A

Points to a handler when control value changes

41
Q

What is added to the q-select component to display a name instead of an id?

A

map-options

42
Q

What component houses the pop-up when a product/sandwich is selected?

A

q-dialog

43
Q

To change the theme, which file needs to be updated in Vue?

A

css\quasar.variables.scss

44
Q

What is the component for a menu?

A

q-menu

45
Q

How do you specify that a button in the menu changes the screen?

A

to=”"

46
Q

What function is used in the script to use the router?

A

useRouter

47
Q

How do you get the function for routers in Vue?

A

import { useRouter } from “vue-router”;

48
Q

What function is used on a router object to change to another page?

A

push
router.push(“tray”);

49
Q

What framework is provided by Microsoft for password hashing?

A

Identity Framework

50
Q

What are the 2 components of our customer logic?

A
  1. Hashed passwords + SALT
  2. JSON Web Tokens
51
Q

What is a JWT?

A

JSON Web Token

52
Q

What is hashing?

A

Scrambling a password using some kind of key

53
Q

What is SHA-2?

A

Secure Hash Algorithm

54
Q

What is salting?

A

A layer of defense from hackers brute-force finding common passwords.

55
Q

Where are JSON Web Tokens stored?

A

HTTP Headers

56
Q

What is added to middleware to allow for JWT?

A

Authentication Scheme

57
Q

Where is the secret string for generating tokens kept?

A

appsettings.json

58
Q

What HTTP method is used when registering or logging into an account?

A

[HttpPost]

59
Q

What is added to the UserController to allow for JWT creation?

A

IConfiguration configuration

60
Q

What does the IConfiguration allow the login function to do?

A

Read the secret string in settings

61
Q

What are the 3 arguments for the VerifyPassword method?

A
  1. Entered Password
  2. Hash from db
  3. Salt from db
62
Q

What attribute is added to the class level of the controllers to force a user to be logged in?

A

[Authorize]

63
Q

What attribute was added to the register and login controller methods to not require being logged in?

A

[AllowAnonymous]

64
Q

What is added to the headers to allow for the token?

A

Authorization, Bearer + token

65
Q

What are the 2 main benefits of the “using” statement in C#?

A
  1. Helps garbage collection via Dispose()
  2. Returns connection to the connection pool
66
Q

What function was called on the DbContext object to begin a transaction?

A

BeginTransactionAsync()

67
Q

What 2 functions were used while adding rows to the database?

A
  1. AddAsync()
  2. SaveChangesAsync()