public IHttpActionResult GetById(int PersonnelId) { PersonnelService personnelService = CreatePersonnelService(); var personnelById = personnelService.GetPersonnelById(PersonnelId); return(Ok(personnelById)); }
public ActionResult GetPersonnelById(int personnelId) { Personnel personnel = _personnelService.GetPersonnelById(personnelId); //return new JsonResult { Data = personnel, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; var personnelJSON = GeneralExtensions.SerializeJSON(personnel); return(Content(personnelJSON, "application/json")); }