コード例 #1
0
 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, ""));
     }
 }
コード例 #2
0
        // GET: Profile
        public IActionResult Index()
        {
            var prof = _profileService.GetById(1);

            return(View(prof));
        }