IW4M-Admin/SharedLibraryCore/Services/MetaService.cs

26 lines
735 B
C#
Raw Normal View History

2018-04-08 02:44:42 -04:00
using SharedLibraryCore.Dtos;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
2018-04-08 02:44:42 -04:00
namespace SharedLibraryCore.Services
{
public class MetaService
{
private static List<Func<int, Task<List<ProfileMeta>>>> MetaActions = new List<Func<int, Task<List<ProfileMeta>>>>();
public static void AddMeta(Func<int, Task<List<ProfileMeta>>> metaAction)
{
MetaActions.Add(metaAction);
}
public static async Task<List<ProfileMeta>> GetMeta(int clientId)
{
var meta = new List<ProfileMeta>();
foreach (var action in MetaActions)
meta.AddRange(await action(clientId));
return meta;
}
}
}