Exemple #1
0
        private static MidFunc BrowseStreams(StreamBrowserResource streamBrowser)
        => async(context, next) =>
        {
            var response = await streamBrowser.Get(
                new ListStreamsOperation(context.Request),
                context.RequestAborted);

            await context.WriteResponse(response);
        };
Exemple #2
0
 public static IApplicationBuilder UseStreamBrowser(
     this IApplicationBuilder builder,
     StreamBrowserResource streamBrowser)
 => builder.MapWhen(IsMatch, Configure(streamBrowser));
Exemple #3
0
 private static Action <IApplicationBuilder> Configure(StreamBrowserResource streamBrowser)
 => builder => builder
 .UseMiddlewareLogging(typeof(StreamBrowserMiddleware))
 .MapWhen(HttpMethod.Get, inner => inner.Use(BrowseStreams(streamBrowser)));
 public static IApplicationBuilder UseStreamBrowser(
     this IApplicationBuilder builder,
     StreamBrowserResource streamBrowser)
 => builder
 .UseMiddlewareLogging(typeof(StreamBrowserMiddleware))
 .MapWhen(HttpMethod.Get, inner => inner.Use(BrowseStreams(streamBrowser)));