Exemplo n.º 1
0
        public IActionResult Delete(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest());
            }

            _storage.Delete(_storage.GetById(id));

            return(Ok());
        }
Exemplo n.º 2
0
        public IActionResult Delete(Guid id)
        {
            if (id == Guid.Empty)
            {
                _logger.LogWarning("Invalid id specified");
                return(BadRequest());
            }

            _storage.Delete(id);

            return(Ok());
        }
Exemplo n.º 3
0
        public IActionResult Delete(Guid id)
        {
            if (id == Guid.Empty)
            {
                _logger.LogWarning("Invalid id specifies");
                return(BadRequest());
            }
            var city = _storage.GetById(id);

            if (city == null)
            {
                _logger.LogWarning("City with id {0} is not found", id);
                return(NotFound());
            }
            _storage.Delete(id);
            return(Ok());
        }