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

Comparing data between two fields rather than using hardcoded values #155

Open
alirezanet opened this issue Feb 23, 2024 Discussed in #153 · 0 comments · May be fixed by #182
Open

Comparing data between two fields rather than using hardcoded values #155

alirezanet opened this issue Feb 23, 2024 Discussed in #153 · 0 comments · May be fixed by #182
Assignees
Labels
enhancement New feature or request

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?

@alirezanet alirezanet added the enhancement New feature or request label Jun 22, 2024
@alirezanet alirezanet changed the title Compare elements nested in a list of the root object Compare to two fields instead of hard an coded value Jun 22, 2024
@alirezanet alirezanet changed the title Compare to two fields instead of hard an coded value Compare two fields instead of hard an coded value Jun 22, 2024
@alirezanet alirezanet changed the title Compare two fields instead of hard an coded value Comparing data between two fields rather than using hardcoded values Jun 22, 2024
@alirezanet alirezanet self-assigned this Jun 22, 2024
@alirezanet alirezanet linked a pull request Jun 22, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant