using Iceshrimp.Backend.Controllers.Mastodon.Renderers; using Iceshrimp.Backend.Controllers.Mastodon.Schemas.Entities; using Iceshrimp.Backend.Core.Database.Tables; namespace Iceshrimp.Backend.Core.Extensions; public static class EnumerableExtensions { public static async Task> AwaitAllAsync(this IEnumerable> tasks) { return await Task.WhenAll(tasks); } public static async Task> RenderAllForMastodonAsync( this IEnumerable notes, NoteRenderer renderer) { return await notes.Select(async p => await renderer.RenderAsync(p)).AwaitAllAsync(); } }