Advanced Search
Search Results
6 total results found
List iteration using span
var list = new List<int>(); foreach(var item in CollectionsMarshal.AsSpan(list)) { } Only usable if the collection is not changed during iteration (read only)
Async Parallel
static Task ParallelForEachAsync<T> (IEnumerable<T> source, int degreeofParallelization, Func<T, Task> body) { async Task AwaitPartition(IEnumerator<T> partition) {...
Batching with LINQ
static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> source, int batchSize) { return source.Select((item, inx) => new { item, inx }) .GroupBy(x => x.inx / batchSize) .Select(g => g.Select(x => x.item)); } https://stackoverfl...
AsyncHelper
public static class AsyncHelper { private static readonly TaskFactory _myTaskFactory = new TaskFactory(CancellationToken.None, TaskCreationOptions.None, TaskContinuat...
Optional<T>
See Attachments
Build project with SourceGenerator on linux
Add Microsoft.Net.Compilers.Toolset package to the project that references the source generator.