예제 #1
0
        public Gender GetGender(int id)
        {
            Gender s_Gender = _GenderService.GetById(id);


            return(s_Gender);
        }
예제 #2
0
        public IHttpActionResult GetById(int id)
        {
            var item = _service.GetById(id);

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

            return(Ok(item));
        }
예제 #3
0
        public IActionResult GetById(int id)
        {
            try
            {
                var entity = _service.GetById(id);

                return(Ok(_mapper.Map <BL.Gender, Gender>(entity)));
            }
            catch (Exception ex)
            {
                return(BadRequest($"{ex.Message}"));
            }
        }
예제 #4
0
        public ActionResult <BaseResult <GenderViewModel> > Get(int id)
        {
            var result = _genderService.GetById(id);

            if (result.Success)
            {
                var resultMap = _mapper.Map <GenderViewModel>(result.Data);

                return(BaseResult <GenderViewModel> .OK(resultMap));
            }

            return(BaseResult <GenderViewModel> .NotOK(result.Messages));
        }