문제

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!

도움이 되었습니까?

해결책

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)
    {
        ...
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top