예제 #1
0
        public ActionResult GoodEntry(Good entry, HttpPostedFileBase cover)
        {
            if (cover != null)
            {
                blobService.UploadByStream(entry.RowKey, cover.InputStream);
            }

            goodService.InsertOrReplace(entry);

            queueService.PushMessage(entry.RowKey);

            return(RedirectToAction("GoodsList", new { id = entry.PartitionKey }));
        }
예제 #2
0
        public override void Run()
        {
            while (true)
            {
                var message = queueService.GetMessage();
                if (message == null)
                {
                    Thread.Sleep(new TimeSpan(0, 1, 0));
                }
                else
                {
                    var good = goodService.GetById(message.AsString);
                    good.IsApproved = true;
                    goodService.InsertOrReplace(good);

                    queueService.DeleteMessage(message.Id, message.PopReceipt);
                }
            }
        }