예제 #1
0
        public IEnumerable <ConcreteEmailMessage> GetAll()
        {
            foreach (var key in _statuses.Keys.ToList())
            {
                var result = new ConcreteEmailMessage()
                {
                    EmailId      = key,
                    EmailMessage = _mails[key]
                };

                yield return(result);
            }
        }
예제 #2
0
        public IEnumerable <ConcreteEmailMessage> GetPendingMails()
        {
            var pendingIds = _statuses
                             .Where(x => x.Value == EmailSendingStatus.Pending)
                             .Select(x => x.Key)
                             .ToList();

            foreach (var pendingId in pendingIds)
            {
                var result = new ConcreteEmailMessage()
                {
                    EmailId      = pendingId,
                    EmailMessage = _mails[pendingId]
                };

                yield return(result);
            }
        }