コード例 #1
0
        public HttpResponseMessage GetLatestOrderDetails(int StoreId)
        {
            ResponseStatus response = new ResponseStatus();

            try
            {
                var data = _repository.GetLatestOrderDetails(StoreId);
                if (data.OrderId > 0)
                {
                    response.isSuccess          = true;
                    response.serverResponseTime = System.DateTime.Now;
                    return(Request.CreateResponse(HttpStatusCode.OK, new { data, response }));
                }
                else
                {
                    response.isSuccess          = false;
                    response.serverResponseTime = System.DateTime.Now;
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, new { response }));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Something Worng !", ex));
            }
        }