示例#1
0
 private static Action <IApplicationBuilder> Configure(AllStreamMessageResource allStreamMessages)
 => builder => builder
 .UseMiddlewareLogging(typeof(AllStreamMessageMiddleware))
 .MapWhen(
     HttpMethod.Get,
     inner => inner.UseAccept(Constants.MediaTypes.HalJson).Use(GetStreamMessage(allStreamMessages)))
 .UseAllowedMethods(allStreamMessages);
示例#2
0
        private static MidFunc GetStreamMessage(AllStreamMessageResource allStreamMessages) => async(context, next) =>
        {
            var response = await allStreamMessages.Get(
                new ReadAllStreamMessageOperation(context),
                context.RequestAborted);

            await context.WriteResponse(response);
        };
示例#3
0
 public static IApplicationBuilder UseAllStreamMessage(
     this IApplicationBuilder builder,
     AllStreamMessageResource allStreamMessages)
 => builder
 .UseMiddlewareLogging(typeof(AllStreamMessageMiddleware))
 .MapWhen(
     HttpMethod.Get,
     inner => inner.UseAccept(Constants.MediaTypes.HalJson).Use(GetStreamMessage(allStreamMessages)))
 .UseAllowedMethods(allStreamMessages);
示例#4
0
 public static IApplicationBuilder UseAllStreamMessage(
     this IApplicationBuilder builder,
     AllStreamMessageResource allStreamMessageResource)
 => builder.MapWhen(IsMatch, Configure(allStreamMessageResource));