コード例 #1
0
        public static Func <HttpContext, Func <Task>, Task> RouteInjections(IApplicationBuilder app)
        {
            return(async(context, next) =>
            {
                var envsConfigurations =
                    (MiaEnvsConfigurations)app.ApplicationServices.GetService(typeof(MiaEnvsConfigurations));

                var miaHeadersPropagator = new MiaHeadersPropagator(context.Request.Headers, envsConfigurations);
                ServiceClientFactory.SetMiaHeaders(miaHeadersPropagator);
                context.Items.Add("MiaHeadersPropagator", miaHeadersPropagator);

                await next.Invoke();
            });
        }
コード例 #2
0
 public static void SetMiaHeaders(MiaHeadersPropagator miaHeadersPropagator)
 {
     _miaHeaders = miaHeadersPropagator.Headers;
 }