コード例 #1
0
        public async Task <ActionResult> Post([FromBody] ScrapeUrl urlData)
        {
            try
            {
                // validate & log request
                var dishes = await _scraper.ScrapeMenuAt(urlData.MenuUrl);

                await _repository.BulkInsertDishesAsync(dishes);

                return(Ok());
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, ex.Message, null);
                throw;
            }
        }