public static void SyncList(ReaderPlatform readerPlatform) { _queryRssChat = readerPlatform.Resolve <IQueryRssChatRelationService>(); var datas = _queryRssChat.GetList().ResponseData; RssList = RssList.Where(x => datas.Select(y => y.Id).Contains(x.Key.Id)).ToDictionary(x => x.Key, y => y.Value); foreach (var item in datas) { if (RssList.Select(x => x.Key.Id).Contains(item.Id)) { continue; } else { RssList.Add(item, DateTimeOffset.Now); } } }
public static void Create(ReaderPlatform readerPlatform) { try { ReaderList.Load(readerPlatform); while (true) { Thread.Sleep(60000); ReaderList.SyncList(readerPlatform); ReaderList.GetLatestNews(); GC.Collect(); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); Create(readerPlatform); } }
public static void Load(ReaderPlatform readerPlatform) { _queryRssChat = readerPlatform.Resolve <IQueryRssChatRelationService>(); RssList = _queryRssChat.GetList().ResponseData.ToDictionary(x => x, x => DateTimeOffset.Now); }