#do i loop through each of the
1 messages · Page 1 of 1 (latest)
you have a few options
you can check if any of the queued actions already present in the list have their data set a specific way
you can also override the GetHashCode method
https://docs.microsoft.com/en-us/dotnet/api/system.object.gethashcode?view=net-6.0
this is what determines whether two objects are "equal"
the second method looks complicated, i think ill do the first
myList.Any(x => x.isAvailable) for example
will return true if any items in the list are available
well that is an easy starting point
x represents one item in the list
Any will return true or false based on the condition
are any available? return true
are none available? return false
does => check each index in the list for x.isAvailable?
think of the => like the contents of a standard loop
so its just a shortened for loop?
yup
oh wow
with some nice syntactical sugar around it
var isAvailable = false;
foreach (var item in list)
{
if (item.isAvailable)
isAvailable = true;
}```