Beispiel #1
0
        public override async Task <Task> ProcessInScope(IServiceProvider serviceProvider)
        {
            Console.WriteLine("Processing starts here");

            _context = serviceProvider.GetService <HavokContext>();
            Havok item = _context.Havoks.First();

            if (item.resourceGroupName != null)
            {
                AzureAppService apps = await GetAzureAppService();

                if (apps.properties.numberOfWorkers > 1)
                {
                    item.isScaledOut = true;
                }
                else
                {
                    item.isScaledOut = false;
                }
                _context.Entry(item).State = EntityState.Modified;
                _context.SaveChanges();
            }

            return(Task.CompletedTask);
        }
Beispiel #2
0
        public async Task <IActionResult> PutHavokItem(long id, Havok item)
        {
            if (id != item.Id)
            {
                return(BadRequest());
            }

            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }