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); }
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()); }