Pregunta

I built a concurrent list class that implements the interfaces IEnumerator<T> and IEnumerable<T>.

My goal is to be able to write:

IEnumrable<string> MyConcurrentList1 = new ConcurrentList<string>();

MyConcurrentList1.AsParallel().MyExtantionMethod_ADD("aaaa");

I want to be able to call the method I wrote in the ConcurrentList<T> from the extenstion method of the ParallelQuery!

¿Fue útil?

Solución

I think you mean to ask: how to add a extension method for behind the AsParallel().

It's simple: the method returns a ParallelQuery. So use something like this:

public static class ExtensionMethods
{
    public static void MyExtantionMethod_ADD(this ParallelQuery query, string parameter1)
    {
        ...
    }
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top