LINQ and Lambda Flashcards

1
Q

Name and describe the two LINQ syntaxes.

A

Query: similar to SQL for the database. It is defined within the C# code.

Method: use extension methods included in the Enumerable or Queryable static class, similar to how you would call the extension methods of any class.

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

When is a LINQ query executed?

A

When the query variable is iterated over.

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

What is an anonymous method?

A

A method without a name they can be defined using the delegate keyword and can be assigned to a variable of delegate type.

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

What is Expression body syntax?

A

Member => Expression

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

What is a lambda expression? Why is it used in LINQ queries?

A

A lambda expression is a convenient way of defining an anonymous function that can be passed around as a variable or as a parameter to a method call. It is used in LINQ queries as a parameter.

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

What is LINQ?

A

Language integerated query is Microsoft .NET Framework component that adds querying capabilities to .NET languages with a syntax similar to SQL.

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