コード例 #1
0
        /// <summary>
        /// Returns updated messages ids
        /// </summary>
        public async Task UpdateDialogsFromApiByIds(IReadOnlyCollection <int> dialogIds)
        {
            var newDialogs = await DialogsClient.GetDialogsByIds(dialogIds);

            if (newDialogs.Any())
            {
                AddUpdateDialogsInCollection(newDialogs, false);
                // ReSharper disable once InconsistentlySynchronizedField
                await DurableCacheManager.SaveDialogs(collection);
            }
        }
コード例 #2
0
        public async Task UpdateDialogsFromApi()
        {
            var newDialogs = await DialogsClient.GetDialogs();

            if (newDialogs.Any())
            {
                AddUpdateDialogsInCollection(newDialogs, true);
                // ReSharper disable once InconsistentlySynchronizedField
                await DurableCacheManager.SaveDialogs(collection);
            }
        }