.Net Deck 5 Flashcards

1
Q

How does one implement this? (Make sure only known users are allowed to execute code)

A

Add[Authorize] to your method signature or on top of the entire controller.

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

How does the web server know who you are across different web requests?

A

Through Cookies

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

Would this method work if you were to switch out browsers in the middle of a session?

A

No, they are browser specific

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

How would you declare an array in C#

A

string[] x = new string[2] // (the 2 creates an array of items)

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

What are Collections in .Net?

A

A container with multiple elements. For example, a list . Collections don’t necessarily have a key, but they do have an index.

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

What are Connection Strings?

A

A connection string is a string that specifies information about a data source and the means of connecting to it. It is passed in code to an underlying driver or provider in order to initiate the connection. Though commonly used for a database connection, the data source could also be a spreadsheet or text file.

The connection string may include attributes such as the name of the driver, server and database, as well as security information such as user name and password

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

What are the different parts of a Connection String?

A

User Id, Password, Database, Server

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

What are Nullable Types?

A

Having a Nullab;e type allows you to assign Null values to variables

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

How do you access the underlying value of a Nullable Type?

A

GetValueOrDefault()

Retrieves the value of the current Nullable object, or the default value of the underlying type.

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

When would you use a Nullable Type?

A

When you have a potential null parameter and you don’t want the default value of the value type, you just want null.

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