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
“ExceptionYieldYield” (Problem)
At what point will happen Exception?
1
public static IEnumerable<int> GetSmallNumbers()
2
{
3
throw new Exception();
4
yield return 1;
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
“ClosureAndFor” (Solution)
Next
“YieldExceptionYield” (Solution)
Last modified 3yr ago
Copy link