BrokenShoeLeague.Web.API.Controllers.SeasonsController.Delete C# (CSharp) Method

Delete() public method

public Delete ( int id ) : IHttpActionResult
id int
return IHttpActionResult
        public IHttpActionResult Delete(int id)
        {
            var season = _brokenShoeLeagueRepository.GetSeasonById(id);
            if (season == null)
                return NotFound();
            _brokenShoeLeagueRepository.RemoveSeason(season);
            try
            {
                _brokenShoeLeagueRepository.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                return NotFound();
            }
            return Ok(new SeasonViewModel(season));
        }