I'm in need of a best solution. Situation is as follows: I intend to use BackgroundWorker to run database queries. Queries themselves require a diverse set of parameters collected (strings, dates, integers, arrays...) from the windows form of some
sort. So far I have thousands of forms and twice as much SQL query methods in my solution and I have to make a coding standard for my team on how to implement the backgroundworker efficiently on those forms. So, the question is how to deliver those arguments
to a worker thread while maintaining ease of maintenance and readability.
Bundling them to object array and pushing them trough an e.Argument reference is not very good solution, for example. It would work but if I have 20something parameters, using them is a coding nightmare (ie. (DateTime?)args) not to mention what it
takes if a want to remove a parameter or how to handle null values (we always use int?, DateTime?...).
Any suggestion is appreciated. Thanks.
View Complete Post