Refactor DataService

In preparation for #177
This commit is contained in:
Alexey Golub
2019-12-03 23:32:48 +02:00
parent b830014a46
commit 457e14d0b6
2 changed files with 112 additions and 86 deletions

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading.Tasks;
namespace DiscordChatExporter.Core.Services.Internal
{
@@ -14,5 +16,15 @@ namespace DiscordChatExporter.Core.Services.Internal
}
public static Color ResetAlpha(this Color color) => Color.FromArgb(1, color);
public static async Task<IReadOnlyList<T>> AggregateAsync<T>(this IAsyncEnumerable<T> asyncEnumerable)
{
var list = new List<T>();
await foreach (var i in asyncEnumerable)
list.Add(i);
return list;
}
}
}