Пример #1
0
        public TelegramBotData( )
        {
            Users = PersistentSet <User> .Build(
                Path.Combine(FolderName, "TelegramBotUsers.json"));

            UserRoles = PersistentDictionary <int, UserRole> .Build(
                Path.Combine(FolderName, "TelegramUserRoles.json"));

            PercentChangeSubscriptions =
                PersistentSet <TelegramPercentChangeSubscription> .Build(
                    Path.Combine(FolderName, "TelegramPercentChangeSubscriptions.json"));

            collections = new List <IPersistentCollection>
            {
                Users,
                UserRoles,
                PercentChangeSubscriptions
            };

            foreach (var collection in collections)
            {
                collection.OnError += OnError;
            }
        }
 private static PersistentDictionary <TKey, TValue> MakeDictionary <TKey, TValue> ( ) =>
 PersistentDictionary <TKey, TValue> .Build(DictionaryFileName);