Iceshrimp.NET/Iceshrimp.Backend/Core/Extensions/EnumerableExtensions.cs
Laura Hausmann 67d1d776c8
[backend/federation] Basic mentions handling (ISH-38)
This implementation adds handling of incoming mentions, including rewriting non-canonical mentions of split domain users into their canonical form when inserting notes into the database.
2024-02-11 18:50:28 +01:00

16 lines
No EOL
442 B
C#

namespace Iceshrimp.Backend.Core.Extensions;
public static class EnumerableExtensions {
public static async Task<IEnumerable<T>> AwaitAllAsync<T>(this IEnumerable<Task<T>> tasks) {
return await Task.WhenAll(tasks);
}
public static async Task<List<T>> AwaitAllNoConcurrencyAsync<T>(this IEnumerable<Task<T>> tasks) {
var results = new List<T>();
foreach (var task in tasks) {
results.Add(await task);
}
return results;
}
}