Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static IEnumerable<TResult> SelectMany<TSource, TResult>(
- this IEnumerable<TSource> source,
- Func<TSource, IEnumerable<TResult>> selector
- )
- public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(
- this IEnumerable<TSource> source,
- Func<TSource, IEnumerable<TCollection>> collectionSelector,
- Func<TSource, TCollection, TResult> resultSelector
- )
- IEnumerable<int> en1 = Enumerable.Range(1, 3);
- IEnumerable<double> en2 = new double[] { 1.0, 3.14 };
- IEnumerable<string> en3 =
- from i1 in en1
- from i2 in en2
- select (i1 * i2).ToString();
- foreach (var i in en3)
- {
- Console.WriteLine(i);
- }
- en1.SelectMany<int, double, string>(delegate (int i1) {
- return en2;
- }, delegate (int i1, double i2) {
- double CS$0$0000 = i1 * i2return CS$0$0000.ToString();
- })
- IEnumerable<int> en4 =
- from i1 in en1
- from i2 in Enumerable.Range(0, i1)
- select i2;
- en1.SelectMany<int, int, int>(delegate (int i1) {
- return Enumerable.Range(0, i1);
- }, delegate (int i1, int i2) {
- return i2;
- })
- public IEnumerable<string> Example(IEnumerable<IEnumerable<string>> enumerable) {
- return enumerable.SelectMany(x => x);
- }
- var orders = Customers.SelectMany(c => c.Orders)
Add Comment
Please, Sign In to add comment