public void Save(SiteAuditDto model)
 {
     if (model.Id == 0)
     {
         _siteAuditRepository.Add(model);
     }
     else
     {
         _siteAuditRepository.Update(model);
     }
 }
        public async Task <SiteAuditDto> StartSiteAudit(SiteAuditDto model)
        {
            _currentSiteAudit = model;

            //TODO: Use a delegate here as this won't work with multiple requests now
            _siteCrawler.OnPageCrawlCompleted += HandleChecks;
            await _siteCrawler.Crawl(model.StartingUrl, model.MaxPagesCrawled ?? int.MaxValue);

            _siteCrawler.OnPageCrawlCompleted -= HandleChecks;
            return(model);
        }