public HttpResponseMessage CountAllTickets(int id = 0) { try { var response = manager.GetAllTicketsCount(id); if (response > 0) { return(Request.CreateResponse(HttpStatusCode.OK, response)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound, 0)); } } catch (Exception ex) { GlobalVariable.log.Write(LogLevel.Error, ex); return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message)); } }