3

I have a number of instances of the following object:

public class Brief{
   public int ID {get; set;}
   public DateTime StartDate {get; set;}
   public DateTime EndDate {get; set;}
} 

I want to run the same console service for all these instances. the service essentially uses the ID property and the dates property to search in a database and return the related records for that particular Bried ID.

my question is what is the best approach to structure my code.

should I create a single class with a List and do a foreach on that list and run the appropriate method or should I create a different instance for each of the objects and then run the services.

1

1 Answer 1

1

I'd go with List. Iterate over each one and fire off the method to do your search in a separate thread. That way all 3 searches are performing at the same time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.