コード例 #1
0
        public void TestDelete()
        {
            ExecuteWithTransaction(() =>
            {
                IQueueItemDAL queueItemDAL = IoC.Container.Resolve <IQueueItemDAL>();

                QueueItemDTO queueItem = new QueueItemDTO
                {
                    BadgeAwardId = 1
                };

                QueueItemDTO addedItem = queueItemDAL.Add(queueItem);
                Assert.IsTrue(addedItem.QueueItemId > 0);

                queueItemDAL.Delete(addedItem.QueueItemId);

                queueItemDAL.Get(addedItem.QueueItemId);
            });
        }
コード例 #2
0
        public void ProcessItem(QueueItemDTO latestItem)
        {
            try
            {
                EarnedBadgeItemDTO earnedBadge = _earnedBadgeDAL.GetEarnedBadge(latestItem.BadgeAwardId);

                RegisterQueueItemProgress(QueueEventType.Processing, latestItem);

                PublishUpdates(earnedBadge);

                _queueItemDAL.Delete(latestItem.QueueItemId);

                RegisterQueueItemProgress(QueueEventType.Processed, latestItem);
            }
            catch
            {
                RegisterQueueItemProgress(QueueEventType.Failed, latestItem);
                throw;
            }
        }