public Gender GetGender(int id) { Gender s_Gender = _GenderService.GetById(id); return(s_Gender); }
public IHttpActionResult GetById(int id) { var item = _service.GetById(id); if (item == null) { return(NotFound()); } return(Ok(item)); }
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}")); } }
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)); }