public HttpResponseMessage DeleteDepartmentOnId(int Id) { try { if (Id != 0) { return(Request.CreateResponse(HttpStatusCode.OK, _departmentService.DeleteDepartmentOnId(Id))); } else { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Id is not getting")); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }