Exemple #1
0
        public static string GetCorrelationId(this IHttpContext context)
        {
            var fieldName = context.Get("CorrelationIdFieldName").ToString();

            return((fieldName != null)
                ? context.Get(fieldName).ToString()
                : null);
        }
Exemple #2
0
        Task Process(IHttpContext context)
        {
            return(Task.Run(() =>
            {
                try
                {
                    Console.WriteLine("Start");
                    foreach (var item in this.funList)
                    {
                        item(context);
                    }

                    var stream = context.Get <Stream>(HttpBuilder.ResponseBody);
                    var response = new HttpResponse(stream)
                    {
                        Content = "test"
                    };

                    response.WriteResponse();
                    context.Dispose();
                    Console.WriteLine("End");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                finally
                {
                    context.Dispose();
                }
            }));
        }