예제 #1
0
        public HttpResponseMessage CountAllClients()
        {
            try
            {
                var response = manager.GetAllClientsCount();

                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));
            }
        }