Horje
c# linq select from object list Code Example
c# linq select from object list
// this will return the first correct answer,
// or throw an exception if there are no correct answers
var correct = answers.First(a => a.Correct); 

// this will return the first correct answer, 
// or null if there are no correct answers
var correct = answers.FirstOrDefault(a => a.Correct); 

// this will return a list containing all answers which are correct,
// or an empty list if there are no correct answers
var allCorrect = answers.Where(a => a.Correct).ToList();




Csharp

Related
make window not resizable wpf Code Example make window not resizable wpf Code Example
List string to file C# Code Example List string to file C# Code Example
c# itext 7 pdf add pdf Code Example c# itext 7 pdf add pdf Code Example
how to make particle in unity Code Example how to make particle in unity Code Example
add all elements in a list c# Code Example add all elements in a list c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12