Skip to content

Instantly share code, notes, and snippets.

@fatbigbright
Created September 28, 2017 01:04
Show Gist options
  • Save fatbigbright/f337b8d42fb60e2f7cd2677309215bd9 to your computer and use it in GitHub Desktop.
Save fatbigbright/f337b8d42fb60e2f7cd2677309215bd9 to your computer and use it in GitHub Desktop.
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