Created
September 11, 2013 12:21
-
-
Save danielwertheim/6522782 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Main2"); | |
var ints = GetInts(); | |
Console.WriteLine("Main2"); | |
foreach (var i in ints) | |
{ | |
Console.WriteLine(i); | |
} | |
Console.WriteLine("Main3"); | |
foreach (var i in ints) | |
{ | |
Console.WriteLine(i); | |
} | |
} | |
////GetInts kommer printas en gång | |
//private static IEnumerable<int> GetInts() | |
//{ | |
// Console.WriteLine("GetInts"); | |
// return Enumerable.Range(1, 10).ToArray(); | |
//} | |
////GetInts kommer printas två gånger | |
//private static IEnumerable<int> GetInts() | |
//{ | |
// Console.WriteLine("GetInts"); | |
// for(var i = 0; i < 10; i++) | |
// { | |
// yield return i; | |
// } | |
//} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment