Пример #1
0
        public async Task <Result <BikeResponse> > GetBikeAsync(string requestId)
        {
            if (!CheckIfExists(requestId))
            {
                return(new Result <BikeResponse>(new BadRequestException(Error.BikeNotFound)));
            }

            return(await _bikeRepository.GetBikeAsync(requestId));
        }
Пример #2
0
        public async Task <IActionResult> GetBike(long bikeId)
        {
            var bike = await _bikeRepository.GetBikeAsync(bikeId);

            if (bike != null)
            {
                return(Ok(bike));
            }
            return(NotFound());
        }