سؤال

BlockingCollection contains only methods to add individual items. What if I want to add a collection? Should I just use "foreach" loop?

Why BlockingCollection doesn't contain method to add a collection? I think such method can be pretty useful.

هل كانت مفيدة؟

المحلول

ICollection interfaces and many of the BCL list-type classes don't have an AddRange method for some reason and it is annoying.

Yes, you'll need to foreach over the collection, you could write you own extension method if you're using it a lot.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top