Exemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            var ok = await _repository.DeleteAsync(id);

            if (ok)
            {
                return(NoContent());
            }

            return(NotFound());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(int id)
        {
            var wasDeleted = await _repository.DeleteAsync(id);

            if (!wasDeleted)
            {
                _log.LogDebug("id={id} not found. Return 404 NotFound", id);
                return(NotFound());
            }

            return(NoContent());
        }