Skip to content
New issue

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

Compare elements nested in a list of the root object #155

Open
alirezanet opened this issue Feb 23, 2024 Discussed in #153 · 0 comments
Open

Compare elements nested in a list of the root object #155

alirezanet opened this issue Feb 23, 2024 Discussed in #153 · 0 comments

Comments

@alirezanet
Copy link
Owner

Discussed in #153

Originally posted by Robotxm February 21, 2024
Hello, I have following object definitions:

public record Item(string Name, List<TimeSchedule> Schedules);

public record TimeSchedule(int Start, int End);

Now I want to find all Items who has a schedule that its End time is before Start time.

With native LINQ I can do this:

List<Item> items =
[
    new Item("Item1", [new TimeSchedule(1, 2), new TimeSchedule(2, 3)]),
    new Item("Item2", [new TimeSchedule(1, 4), new TimeSchedule(4, 3)]),
    new Item("Item3", [new TimeSchedule(3, 2), new TimeSchedule(2, 3)]),
];

var results = items.Where(x => x.Schedules.Any(s => s.End < s.Start));

So how can I achieve this using Gridify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant