I’m working with a list of objects in C#, each contains a DateTime property and I need to know if n of the objects happened in an hour.
Do I have to compare each of the objects? Is there a quicker way? I don’t know, can this be done with Linq?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use
Where+Count:Of course this is the same as a simple loop. But that’s the way you have to go.
You could also use
GroupBybut i don’t see why you could need it.