c# - Parallel.ForEach with MatchCollection -
first off, know duplicate of this question, can't solution listed there work me. understand matchcollection not implement ienumerable parallel.foreach uses, , need oftype()... idea i'm doing wrong? here's setup:
matchcollection startmatches = regex.matches(temprtb.text, startpattern); system.threading.tasks.parallel.foreach(startmatches.oftype<match>, m => { // stuff m });
and here's compile error get:
error 11 type arguments method 'system.threading.tasks.parallel.foreach<tsource>(system.collections.generic.ienumerable<tsource>, system.action<tsource>)' cannot inferred usage. try specifying type arguments explicitly.
all missing ()
(oftype static extension method)
system.threading.tasks.parallel.foreach(startmatches.oftype<match>(), m => { // stuff m });
Comments
Post a Comment