Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Terrible Object
- var hasAllTheItems =
- new[]
- {
- new[]
- {
- new
- {
- Name = "Test"
- }
- },
- new[]
- {
- new
- {
- Name = "Test2"
- },
- new
- {
- Name = "Test3"
- }
- }
- };
- #endregion Terrible Object
- var a = hasAllTheItems.Select(x => x.Select(y => y.Name));
- var b = hasAllTheItems.SelectMany(x => x.Select(y => y.Name));
- var c = hasAllTheItems.Select(x => x.SelectMany(y => y.Name));
- var d = hasAllTheItems.SelectMany(x => x.SelectMany(y => y.Name));
- Assert.AreEqual(2, a.Count());
- Assert.AreEqual(3, b.Count());
- Assert.AreEqual(2, c.Count());
- Assert.AreEqual(14, d.Count());
Advertisement
Add Comment
Please, Sign In to add comment