using BotSharp.Platform.Abstractions; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Text; namespace BotSharp.Core.ContextStorage { public class ContextStorageServiceRegister { public static void Register(IServiceCollection services) { services.AddSingleton, ContextStorageFactory>(); services.AddSingleton>(); services.AddSingleton(factory => { Func> accesor = key => { if (key.Equals("ContextStorageInFile")) { return factory.GetService>(); } else { throw new ArgumentException($"Not Support key : {key}"); } }; return accesor; }); } } }