I have the following linq expression in lambda syntax:
var myValue = 6;
var from = 2;
var to = 8;
var res = MyList.Where(m => m.person.Id == person.Id
In Addition to this, if you want to pass the values to IsBetween method from MyList.
Take a wrapper class (here Person) contains the same properties to be passed to the method. and do something like this:
var res = MyList.Where(m => m.person.Id == person.Id)
.Select(x => new Person { p1 = x.p1, p2 = x.p2 })
.AsEnumerable()
.where(x => (IsBetween(x.p1, x.p2)))
.ToList());