Exemple #1
0
        public IActionResult PutBike(Bike bike)
        {
            if (!_repository.BikeExist(bike.Id))
            {
                return(NotFound());
            }
            _repository.UpdateBike(bike);

            try
            {
                _repository.Save();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_repository.BikeExist(bike.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }