private async Task <Websites> AddItemToQueue(WebsiteViewModel model, int index)
        {
            using (var context = new PerformancePresentationContext())
            {
                var website = new Websites
                {
                    Name   = model.Name + " - " + index,
                    Url    = model.Url,
                    IsDone = false
                };

                context.Websites.Add(website);

                await context.SaveChangesAsync();

                await _azureQueueService.AddItemToQueue(website);

                return(website);
            }
        }
        public IActionResult IsDone(int id)
        {
            var context = new PerformancePresentationContext();

            return(Json(context.Websites.Any(w => w.Id == id && w.IsDone)));
        }
Example #3
0
 public AzureQueue(PerformancePresentationContext databaseContext)
 {
     _databaseContext = databaseContext;
 }