I have a simple set of arrays, kind of like this .. structure shortened for brevity and such. Basically it is a list of identities with an additional field (a sort of dictionary).
[
{
"Id" : 1,
"Requirement" : {
"Value" : "2", "Name" : "Orders"
}
},
{
"Id" : 2,
"Requirement" : {
"Value" : "4", "Name" : "Orders"
}
},
{
"Id" : 3,
"Requirement" : {
"Value" : "6", "Name" : "Orders"
}
},
{
"Id" : 4,
"Requirement" : {
"Value" : "8", "Name" : "Orders"
}
},
]
I need to be constantly checking another value against this array, and pulling in the items that are satisfied (for instance, the 'user' has an arbitrary value of Orders
that is an integer. Each time Orders
updates, I want to get all items out of the array where Orders
is greater than or equal to the Requirement value, but without pulling in values they already have)
So then, this would work as follows ...
User
has 1 Order
. (Nothing Happens)
User
has 2 Order
. (Id 1 is pulled when the user's update operation runs)
User
then achieves 4 Order
. (Id 2 is pulled in, but Id 1 already exists, so it is skipped)
Is there a simplistic way to achieve this with a LINQ query? I don't have the luxury of storing the 'last checked' value. The data structure is not one I can modify at this point in time.