Created
December 4, 2014 20:56
-
-
Save mattpodwysocki/8a966cff64d35c7cc439 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
var parents = new[] | |
{ | |
new | |
{ | |
name = "stu", | |
children = new[] | |
{ | |
new {name = "john"}, | |
new {name = "audrey"}, | |
new {name = "eustace"} | |
} | |
}, | |
new | |
{ | |
name = "bob", | |
children = new[] | |
{ | |
new {name = "seymour"}, | |
new {name = "andre"}, | |
new {name = "pascal"} | |
} | |
} | |
}; | |
parents.ToObservable().Select(parent => | |
{ | |
return Observable.Defer(() => | |
{ | |
Console.WriteLine("parent {0}", parent.name); | |
return Observable.ToObservable(parent.children); | |
}); | |
}) | |
.Concat() | |
.Subscribe(child => Console.WriteLine("child {0}", child.name)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment