コード例 #1
0
        public IActionResult ReturnScooter(int id, [FromBody] Customer customer)
        {
            var returned = _scooterRepository.ReturnScooter(id, customer.Id);

            if (!returned)
            {
                ModelState.AddModelError("", $"You are not entitled to return the scooter or the Id you entered is wrong");
                return(StatusCode(500, ModelState));
            }
            return(Ok());
        }