using BotSharp.Core; using BotSharp.Platform.Abstraction; using BotSharp.Platform.Models; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace BotSharp.Core.AgentStorage { public class AgentStorageFactory : IAgentStorageFactory where TAgent : AgentBase { private readonly Func> func; private readonly IPlatformSettings platformSetting; public AgentStorageFactory(IPlatformSettings setting, Func> serviceAccessor) { this.func = serviceAccessor; this.platformSetting = setting; } public async Task> Get() { IAgentStorage storage = null; string storageName = this.platformSetting.AgentStorage; storage = func(storageName); return storage as IAgentStorage; } } }