Example #1
0
        public IHttpActionResult Run([FromBody] RunCrawlerConfigurationDto runCrawlerConfigurationDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var id = Guid.NewGuid();

            try
            {
                _commandDispatcher.Dispatch(new RunCrawlerCommand(id, 0, runCrawlerConfigurationDto));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }

            return(Ok(id));
        }
 public RunCrawlerCommand(Guid id, int version, RunCrawlerConfigurationDto runCrawlerConfigurationDto) : base(id, version)
 {
     RunCrawlerConfigurationDto = runCrawlerConfigurationDto;
 }