Develop the UX Flashcards

SEO, global and localization strategies

1
Q

asp-action

A

tag helper that tells Razor what controller action we want to use on submit

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

asp-controller

A

tag helper to let our form know which controller to find the action in

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

ApplicationDbContext

A

provides the context to interface with the database and is referenced in the models

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

DbContext

A

Within ApplicationDbContext and teaches entity framework how the database will work

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

DbSet

A

a collection that represents an individual database table or view

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

private readonly ApplicationDbContext _context;

public AController(ApplicationDbContext Context)

A

allows for the same instance of the DbContext to be used instead of being created each time we request it

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

Inversion of Control

A

allows us to loosen the coupling of dependencies

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

_context.SaveChanges()

A

required to actually push the changes to the database (can do multiple then call)

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

startup.cs

A

configure the application and let it know what is is going to use

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

asp-for=”Name”

A

Tag helper - will populate the label with a field’s Name and also set the type, id, and name attributes on an input field

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

[Display(Name = “Name with Space”)]

A

Data Annotation - sets the display name which gets passed asp-for what you want the label to be

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

_ViewStart.cshtml

A

allows us to set code that applies when you return a view:

@{ Layout = “_Layout”; }

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

@ViewData

A

is a dictionary that allows us to pass data from our controller to our view

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

@RenderSection

A

acts as a placeholder to pass specific content into the page (can be set as required or optional)

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

@RenderBody

A

where all content not set to a specific section will be rendered

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

@section

A

will match up with any RenderSection with a matching name and replace it with its content

17
Q

Partial views

A

can be used for duplicate formatting that is applied multiple times to reduce repeat code

18
Q

@Html.EditorForModel()

A

automatically creates labels and input fields in this form based on properties in the model

19
Q

Shared/EditorTemplates

A

Folder to hold field overrides that Razor uses to auto-generate fields

20
Q

Application wide route formatting

A

do within the startup.cs

21
Q

routing for specific actions

A

do within the select controller

22
Q

[Route(“”)]

A

set a custom route for a given action

23
Q

[HttpGet]

A

specify for an action to only allow a GET request

24
Q

[Key]

A

Data Annotation - to make sure field is unique

25
Q

[Required]

A

Data Annotation - makes field non-nullable

26
Q

[MinLength(3)]

A

Data Annotation - makes field have a minimum length

27
Q

asp-validation-summary=”All”

A

used to display errors for the given model and will include all, not just a specific field

28
Q

ModelState.IsValid

A

checks the current state of the model and can be referenced to handle errors (auto populates asp-validation-summary)

29
Q

ModelState.AddModelError(“A”, “B”)

A

manually adds an error for the given field name (A) and the appropriate error message to display (B)

30
Q

[A(ErrorMessage = “B”)]

A

Data Annotation - For a given rule (A) set a more semantic error message (B)

31
Q

_ViewImports

A

Way to add things that will appear on every page (usually @using statements such as controllers)

32
Q

@addTagHelper *, A

A

_ViewImports component that brings in the most recent version of the associated tag helper library (A)

33
Q

[HttpGet(“A”)]

A

Can change the routing for a given action to specify the desired URL (A)

34
Q

asp-validation-for=”A”

A

tag helper to display an error for a specific field (A)