Skip to content

Instantly share code, notes, and snippets.

@leppie
Created September 2, 2016 18:03
Show Gist options
  • Save leppie/19640049c57b82871c9561b4a39c30d4 to your computer and use it in GitHub Desktop.
Save leppie/19640049c57b82871c9561b4a39c30d4 to your computer and use it in GitHub Desktop.
class Foo
{
public string Bar {get;set;}
}
string Baz<T>(T t, Func<T, string> sel)
{
return sel(t);
}
var f = new Foo(5);
var s = Baz(f, Foo.Bar); // or Foo::Bar
IEnumerable<Foo> f = ...;
var q = f.Select(Foo.Bar); // or Foo::Bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment