public IHttpActionResult GetProgrammer(string userId) { ProgrammerDTO programmer = null; try { programmer = _programmerService.Get(userId); } catch (ValidationException) { return(NotFound()); } catch (Exception) { InternalServerError(); } return(Ok(Mapper.Map <ProgrammerDTO, ProgrammerModel>(programmer))); }
public ActionResult UserDetails(int id) { return(Json(programmers.Get(id), JsonRequestBehavior.AllowGet)); }