Example #1
0
        // DELETE: api/Regencies/5
        public HttpResponseMessage DeleteRegency(int id)
        {
            var message = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");

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