示例#1
0
        private async Task SetWebsiteToDoneInDb(Websites website)
        {
            var dbWebsite = _databaseContext.Websites.Find(website.Id);

            if (dbWebsite != null)
            {
                dbWebsite.IsDone = true;
                await _databaseContext.SaveChangesAsync();
            }
        }
        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);
            }
        }