How can I make this work with deep properties
- by Martin Robins
Given the following code...
class Program {
static void Main(string[] args) {
Foo foo = new Foo { Bar = new Bar { Name = "Martin" }, Name = "Martin" };
DoLambdaStuff(foo, f => f.Name);
DoLambdaStuff(foo, f => f.Bar.Name);
}
static void DoLambdaStuff<TObject, TValue>(TObject obj,…