예제 #1
0
        public IActionResult GetAvailableScooters()
        {
            var availableScooters = _scooterRepository.GetAvailableScooters();
            var scootersDto       = new List <ScooterDto>();

            foreach (var scooter in availableScooters)
            {
                scootersDto.Add(new ScooterDto
                {
                    Id        = scooter.Id,
                    Make      = scooter.Make,
                    Model     = scooter.Model,
                    Available = scooter.Available,
                    Damaged   = scooter.Damaged
                });
            }
            return(Ok(scootersDto));
        }