コード例 #1
0
        public void Load()
        {
            HistoryMessage = RepositoryProvider.GetRepository().Get <List <Message> >($"{_persistIdentity}_HistoryMessage") ?? new List <Message>();
            ErrorMessage   = RepositoryProvider.GetRepository().Get <List <Message> >($"{_persistIdentity}_ErrorMessage") ?? new List <Message>();
            PendingMessage = RepositoryProvider.GetRepository().Get <List <Message> >($"{_persistIdentity}_PendingMessage") ?? new List <Message>();
            PendingMessage.ForEach(QueueMessager.Enqueue);
            var queuedMessages = RepositoryProvider.GetRepository().Get <List <Message> >($"{_persistIdentity}_QueuedMessage") ?? new List <Message>();

            queuedMessages.ForEach(QueueMessager.Enqueue);
        }
コード例 #2
0
 public void Save()
 {
     lock (_lock)
     {
         RepositoryProvider.GetRepository().Save <List <Message> >($"{_persistIdentity}_HistoryMessage", HistoryMessage);
         RepositoryProvider.GetRepository().Save <List <Message> >($"{_persistIdentity}_ErrorMessage", ErrorMessage);
         RepositoryProvider.GetRepository().Save <List <Message> >($"{_persistIdentity}_PendingMessage", PendingMessage);
         RepositoryProvider.GetRepository().Save <List <Message> >($"{_persistIdentity}_QueuedMessage", QueueMessager.GetQueuedMessages());
     }
 }