A repository of handy C# utilities.
- RangeEnumerator. Use ranges in your foreach loops like
foreach (int i in 0..9)
. - TimeSpan.GetAwaiter.
await
aTimeSpan
. - A
GenericBenchmark
class for repurposing the test explorer GUI for a benchmark suite. - A
TypedFactory<T>
class which is effectively a macro ofserviceProvider.GetRequiredService<T>()
. My primary use case for this is to more easily consume typedHttpClient
s in Singleton services. - A
.WhenAll
extension method forTask
s andValueTask
s. Now you can further chain your async LINQ.
Please reference the unit tests.
- NativeAOT compat