Created
May 19, 2019 19:24
-
-
Save mitiko/c1f361affeb9ac9b4698dbb04b3a8611 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
public void A(Func<string> x) | |
{ | |
for (int i = 0; i < 10; i++) | |
{ | |
var data = x.Invoke(); | |
Console.WriteLine(data); | |
Console.WriteLine(i); | |
} | |
} | |
public Func<string> B(string fileName) | |
{ | |
// process fileName | |
var data = File.ReadAllText(fileName); | |
return () => data; | |
} | |
public void Main() | |
{ | |
A(B("/home/user1/a.txt")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment