Example #1
0
        // PUT: api/Regencies/5
        public HttpResponseMessage UpdateRegency(int id, RegencyParam RegencyParam)
        {
            var message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "Bad Request");

            if (string.IsNullOrWhiteSpace(id.ToString()))
            {
                message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "Invalid Id");
            }
            else
            {
                var get = _iRegencyService.Update(id, RegencyParam);
                if (get)
                {
                    message = Request.CreateResponse(HttpStatusCode.OK, get);
                    return(message);
                }
            }
            return(message);
        }
 // PUT: api/Regencies/5
 public void Put(int id, RegencyParam regencyParam)
 {
     _regencyService.Update(id, regencyParam);
 }