public class DataGatherer
{
static async Task<Dictionary<string, object>> GetData()
{
Dictionary<string, object> dict = new Dictionary<string, object>();
using HttpClient client = new();
try
{
var tasks = new Task[] {
Task.Run(async () => await ExternalTablesGatherer.ProcessRepositoriesAsync(client, "6382963", dict)),
Task.Run(async () => await QueueDataGatherer.GetDataAsync(client, "6010081", dict))
};
await Task.WhenAll(tasks);
return dict;
}
catch (Exception exception)
{
Console.WriteLine(exception);
return null;
}
}
}
public class DataGatherer
{
static async Task<Dictionary<string, object>> GetData()
{
Dictionary<string, object> dict = new Dictionary<string, object>();
using HttpClient client = new();
try
{
var tasks = new Task[] {
Task.Run(async () => await ExternalTablesGatherer.ProcessRepositoriesAsync(client, "6382963", dict)),
Task.Run(async () => await QueueDataGatherer.GetDataAsync(client, "6010081", dict))
};
await Task.WhenAll(tasks);
return dict;
}
catch (Exception exception)
{
Console.WriteLine(exception);
return null;
}
}
}