0
daws created
Hi :D
I have a console application which needs to call several different repository.GetAllListAsync() methods. I'm trying to get the different calls to run in parallel with Task.WaitAll in my main method.
However, since all repositories share the same context, I get the following error: "A second operation started on this context before a previous asynchronous operation completed.".
Is there a way for my console application to run each GetAllListAsync() call in parallel ?
Thanks
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
1 Answer(s)
-
0
If you are not in a UOW, there is no problem. They will all use their own UOW and dbcontext. So, be sure to not start a UOW while using them. If this is not possible, there is no way since this is a restriction of EF.
Have a nice day :)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)