mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
migrating to .NET Core 2.0
This commit is contained in:
25
SharedLibraryCore/Services/MetaService.cs
Normal file
25
SharedLibraryCore/Services/MetaService.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using SharedLibraryCore.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user