using BotSharp.Platform.Abstractions; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace BotSharp.Core.ContextStorage { public class ContextStorageFactory : IContextStorageFactory { private readonly Func> func; private readonly IPlatformSettings platformSetting; public ContextStorageFactory(IPlatformSettings setting, Func> serviceAccessor) { this.func = serviceAccessor; this.platformSetting = setting; } public IContextStorage Get() { IContextStorage storage = null; string storageName = this.platformSetting.ContextStorage; storage = func(storageName); return storage as IContextStorage; } } }