コード例 #1
0
        public void UpdateBugStatus(int bugId, BugStatus bugStatus)
        {
            var bug = _bugRepository.GetById(bugId);

            if (bug.StatusID == (byte)bugStatus)
            {
                return;
            }

            var queueMessage = string.Format("[email protected] status {0} {1}", Enum.Parse(typeof(BugStatus), bug.StatusID.ToString()), bugStatus);

            bug.StatusID = (byte)bugStatus;
            _bugRepository.Update(bug);
            _bugRepository.Save();
            _queueService.AddMessageToQueue(queueMessage);
        }
コード例 #2
0
        public void TestMethod1()
        {
            QueueService myQueue = new QueueService();

            myQueue.AddMessageToQueue("Gustavo", "myqueue");
            string result = myQueue.GetNextMessageFromQueue("myqueue");

            Assert.AreEqual("Gustavo", result);
        }
コード例 #3
0
        public async Task <ActionResult> DeleteAsync(int recipeid)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureStorage"].ConnectionString);
            CloudQueueClient    queueClient    = storageAccount.CreateCloudQueueClient();
            CloudQueue          recipesQueue   = queueClient.GetQueueReference("deleterecipe");
            QueueService        queueService   = new QueueService();

            queueService.AddMessageToQueue(recipesQueue, recipeid.ToString());

            CloudQueue recipesOutQueue = queueClient.GetQueueReference("outrecipe");

            await queueService.GetMessageFromQueue(recipesOutQueue);

            return(RedirectToAction("Profile", "User"));
        }