P
P
ProblemBook.NET
Search…
P
P
ProblemBook.NET
ProblemBook.NET
LANGS
Задачник.NET
ProblemBook.NET
Oop
Strings
Linq
“YieldExceptionYield” (Problem)
“QueryAfterRemove” (Problem)
“ClosureAndVariable” (Problem)
“QueryWithInc” (Solution)
“QueryWithInc” (Problem)
“LifeAfterYield” (Solution)
“LifeAfterYield” (Problem)
“EnumerableToArray” (Solution)
“EnumerableToArray” (Problem)
«YieldExceptionYield» (Solution)
“ExceptionYieldYield” (Solution)
“ClosureAndForeach” (Solution)
“TryYieldFinally” (Problem)
“ClosureAndFor” (Solution)
“ExceptionYieldYield” (Problem)
“YieldExceptionYield” (Solution)
“ClosureAndForeach” (Problem)
“ClosureAndVariable” (Solution)
“QueryAfterRemove” (Solution)
“ClosureAndFor” (Problem)
Multithreading
ValueTypes
Math
Summary
Introduction
Attribution-NonCommercial-NoDerivatives 4.0 International
Powered By GitBook
“YieldExceptionYield” (Problem)
At what point will happen Exception?
1
public static IEnumerable<int> GetSmallNumbers()
2
{
3
yield return 1;
4
throw new Exception();
5
yield return 2;
6
}
7
void Main()
8
{
9
var numbers = GetSmallNumbers();
10
var evenNumbers = numbers.Select(n => n * 2);
11
Console.WriteLine(evenNumbers.FirstOrDefault());
12
}
Copied!
​Solution​
Previous
Linq
Next
“QueryAfterRemove” (Problem)
Last modified 3yr ago
Copy link