Exemplo n.º 1
0
        ///<summary>
        ///Extension method to add the AnarchyMiddleware to the IApplicationBuilder interface.
        ///</summary>
        public static IApplicationBuilder UseAnarchy(
            this IApplicationBuilder builder, Action <AnarchyConfig> configure)
        {
            var anarchyConfig = new AnarchyConfig();

            configure(anarchyConfig);
            return(builder.UseMiddleware <AnarchyMiddleware>(anarchyConfig));
        }
Exemplo n.º 2
0
 ///<summary>
 ///AnarchyMiddle constructor used by Middleware pipeline.
 ///</summary>
 public AnarchyMiddleware(RequestDelegate next, AnarchyConfig config)
 {
     _next   = next;
     _config = config;
     _rng    = new Random();
 }