Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6758507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:48:01+00:00 2026-05-26T13:48:01+00:00

I have a list of work that I’m trying to work on until all

  • 0

I have a list of work that I’m trying to work on until all work is depleted, but not sure how to handle this. The idea I’m trying to emulate is:

foreach(Work w in _workList) {
   res = DoSomethingOnWork(w);
   if(res) {
       _workList.Remove(w);
   }
}

Reason being, when in “DoSomethingForWork(w)” the work may not be what I want to do at that moment, so I’ll skip that one and move on to the next. When I’m at the end of the list, I want to go back through the list. Before I go write a collection to handle this, I was curious if there was already something in .NET for handling this situation.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:48:02+00:00Added an answer on May 26, 2026 at 1:48 pm

    This sort of thing is what the Queue class is for. It holds a collection, and you just dequeue each item to work it. It is a last-in, last-out collection.

    If you decide to skip one, you can requeue it for later.

    You can also take a look at the Stack class, which is similar but is a last-in, first-out collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of work items that need to be processed in order.
I have some event handlers that work in FF and not in Safari. Simply
I have text files that have list of thousands of names like this DallasWebJobs
I have list of files(widgets) that I need to do some work on. I
I have work that needs to be done in this order: In main activity:
We have a system at work that gets a list of ips from a
So I have a big list of integers I have to work with (in
i have list of rows that user select and i want to delete them,
I have list of files which contain particular patterns, but those files have been
I'm trying to write a class that has a generic member variable but is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.