Esempio n. 1
0
        public async Task <IActionResult> Delete(int id)
        {
            var stop = _repository.GetStopById(id);

            if (stop == null)
            {
                return(NotFound());
            }
            _repository.DeleteStop(stop);

            if (await _repository.SaveChangesAsync())
            {
                return(Ok("Stop Deleted"));
            }

            return(BadRequest("Failed to Delete Stop"));
        }