public IActionResult Scan([FromQuery] Guid siteId) { var sc = _siteConfigurationService.GetSiteConfiguration(siteId); _scanRequestService.Scan(ScanRequestDto.Create(sc.SiteId)).Wait(); return(View("Index")); }
public async Task <IActionResult> Scan([FromBody] ScanRequestDto request) { var sc = _siteConfigurationService.GetSiteConfiguration(request.SiteId); await _scanRequestService.Scan(ScanRequestDto.MapTo(request)); return(NoContent()); }
public IActionResult Index([FromQuery(Name = "siteId")] Guid?siteId) { var config = _siteConfigurationService.GetSiteConfiguration(siteId.Value); var configDto = config == null ? SiteConfigurationDto.Create(siteId.Value) : SiteConfigurationDto.MapFrom(config); return(View(configDto)); }
public async Task Scan(ScanRequest scanRequest) { SiteId = scanRequest.SiteId; scanRequest.Id = await CreateScanRequest(scanRequest); var siteConfiguration = _siteConfigurationService.GetSiteConfiguration(scanRequest.SiteId); _taskQueue.QueueBackgroundWorkItem(async action => { await DoWorkScan(scanRequest, siteConfiguration); }); }