示例#1
0
        public async Task <ActionResult <PenaltyResponse> > GetPenaltyById(int?id)
        {
            if (id == null)
            {
                return(BadRequest("empty id"));
            }

            var penalty = await _penaltyRepository.GetById(id);

            if (penalty == null)
            {
                return(NotFound());
            }

            return(Ok(new Response <PenaltyResponse>(
                          _customMapper.PenaltyToPenaltyResponse(penalty))));
        }