Ejemplo n.º 1
0
        public async Task <HttpResponseMessage> Post(string contextId, string lineItemId, LisResult result)
        {
            try
            {
                var context = new PostResultContext(contextId, lineItemId, result);

                await OnPostResult(context);

                return(context.StatusCode == HttpStatusCode.Created
                    ? Request.CreateResponse(context.StatusCode, context.Result, new ResultFormatter())
                    : Request.CreateResponse(context.StatusCode));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
            }
        }
Ejemplo n.º 2
0
        public async Task<HttpResponseMessage> Post(string contextId, string lineItemId, LisResult result)
        {
            try
            {
                var context = new PostResultContext(contextId, lineItemId, result);

                await OnPostResult(context);

                return context.StatusCode == HttpStatusCode.Created
                    ? Request.CreateResponse(context.StatusCode, context.Result, new ResultFormatter())
                    : Request.CreateResponse(context.StatusCode);
            }
            catch (Exception ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
            }
        }