コード例 #1
0
        public HttpResponseMessage BuscarDisco(int id)
        {
            try
            {
                var album = _albumService.BuscarAlbum(id);

                JsonResult.Status  = true;
                JsonResult.Object  = album;
                JsonResult.Message = "Disco localizado com  sucesso";
                return(Request.CreateResponse(HttpStatusCode.OK, JsonResult));
            }
            catch (Exception ex)
            {
                JsonResult.Status  = false;
                JsonResult.Message = ex.Message;
                return(Request.CreateResponse(HttpStatusCode.BadRequest, JsonResult));
            }
        }