我的問題是關於組合PLINQ和yield關鍵字的結果。如果我這樣寫: //Some stuff here
foreach (var x in collection.AsParallel())
{
yield return new CustomObject
{
property1 = //Large calculations here
property
下面是一個示例PLINQ查詢我在一個Windows服務中定期運行: var resultList = new List<Task<SendMailResult>>();
try
{
resultList = emailsToSend
.AsParallel().WithDegreeOfParallelism(10)
.Select(async e =>
在LINQ查詢創建新的獨立的任務時運行LINQ查詢.asparallel,我已經使用.AsParallel如下: var completeReservationItems = from rBase in reservation.AsParallel()
join rRel in relationship.AsParallel() on rBase.GroupCode e