Created
September 28, 2017 01:04
-
-
Save fatbigbright/f337b8d42fb60e2f7cd2677309215bd9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
public class Foo | |
{ | |
public int X { get; set; } | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Func<int, int> del1 = x => x + 1; | |
Action<Foo> del2 = f => f.X += 1; | |
var foo = new Foo { X = 5 }; | |
del2(foo); | |
Console.Write("{0}", del1(5)); | |
Console.Write("{0}", foo.X); | |
del1(foo.X); | |
Console.Write("{0}", foo.X); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment