public HttpResponseMessage Get(int id) { try { var ret = _profileService.GetById(id); var retView = Mapper.Map <Domain.Models.Profile, ProfileViewModel>(ret); return(retView != null?Request.CreateResponse(HttpStatusCode.OK, retView) : Request.CreateResponse(HttpStatusCode.NotFound)); } catch { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "")); } }
// GET: Profile public IActionResult Index() { var prof = _profileService.GetById(1); return(View(prof)); }