We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
groupJoin produces empty result when inner is empty. Let's see the following example.
groupJoin
const Enumerable = require("node-enumerable"); const persons = [ { name: "Tanja" }, { name: "Marcel" }, { name: "Yvonne" }, { name: "Josefine" } ]; const pets = []; const e = Enumerable.from(persons) .groupJoin( pets, person => person.name, pet => pet.owner.name, (person, pets) => { person, pets } ) .toArray();
Online runner The example will result in an empty array [].
[]
Expected result would be:
[ { person: { name: "Tanja" }, pets: [] }, { person: { name: "Marcel" }, pets: [] }, { person: { name: "Yvonne" }, pets: [] }, { person: { name: "Josefine" }, pets: [] } ]
Corresponding C# code produces the expected result.
using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { var people = new Person[] { new Person("Tanja"), new Person("Marcel"), new Person("Yvonne"), new Person("Josefine") }; var pets = new Pet[0]; var e = people.GroupJoin( pets, person => person.Name, pet => pet.Owner.Name, (person, ps) => new { Person = person, Pets = ps } ).ToArray(); } } public class Person { public string Name { get; set; } public Person(string name) { Name = name; } } public class Pet { public string Name { get; set; } public Person Owner { get; set; } public Pet(string name, Person owner) { Name = name; Owner = owner; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
groupJoin
produces empty result when inner is empty. Let's see the following example.Online runner
The example will result in an empty array
[]
.Expected result would be:
Corresponding C# code produces the expected result.
The text was updated successfully, but these errors were encountered: