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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -