LINQ and Lambda Flashcards
Name and describe the two LINQ syntaxes.
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.
When is a LINQ query executed?
When the query variable is iterated over.
What is an anonymous method?
A method without a name they can be defined using the delegate keyword and can be assigned to a variable of delegate type.
What is Expression body syntax?
Member => Expression
What is a lambda expression? Why is it used in LINQ queries?
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.
What is LINQ?
Language integerated query is Microsoft .NET Framework component that adds querying capabilities to .NET languages with a syntax similar to SQL.