public async Task <IActionResult> Refresh()
        {
            _logger.LogInformation("[api-stub/refresh] called");
            await _service.Refresh();

            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Delete([FromQuery] HttpMethod httpMethod, [FromQuery] string url)
        {
            _logger.LogInformation("[api-stub/save] called with parameters {httpMethod}, {url}", httpMethod, url);
            if (url == null)
            {
                throw new ArgumentException(nameof(url));
            }

            await _repository.Delete(httpMethod, url);

            await _service.Refresh();

            return(Ok());
        }
        public async Task <ActionResult> Save([FromQuery] HttpMethod httpMethod, [FromQuery] string url, [FromBody] object jsonData)
        {
            _logger.LogInformation("[api-stub/save] called with parameters {httpMethod}, {url}, {jsonData}", httpMethod, url, jsonData);
            if (url == null)
            {
                throw new ArgumentException(nameof(url));
            }
            if (jsonData == null)
            {
                throw new ArgumentException(nameof(jsonData));
            }

            await _repository.InsertOrReplace(httpMethod, url, jsonData);

            await _service.Refresh();

            return(Ok());
        }