Ejemplo n.º 1
0
        private async Task SlowTaskStatusCode(HttpContext httpContext)
        {
            var handler = new MyHandler();
            var result  = await handler.SlowTaskStatusCode();

            await result.ExecuteAsync(httpContext);
        }
Ejemplo n.º 2
0
        private Task HelloDavid(HttpContext httpContext)
        {
            var handler = new MyHandler();
            var result  = handler.HelloDavid();

            return(new ObjectResult(result).ExecuteAsync(httpContext));
        }
Ejemplo n.º 3
0
        private async Task PostAForm(HttpContext httpContext)
        {
            var handler = new MyHandler();
            var form    = await httpContext.Request.ReadFormAsync();

            handler.PostAForm(form);
        }
Ejemplo n.º 4
0
        private Task Authed(HttpContext httpContext)
        {
            var handler = new MyHandler();

            handler.Authed();
            return(Task.CompletedTask);
        }
Ejemplo n.º 5
0
        private async Task FastValueTaskStatusCode(HttpContext httpContext)
        {
            var handler       = new MyHandler();
            var loggerFactory = httpContext.RequestServices.GetRequiredService <ILoggerFactory>();
            var result        = await handler.FastValueTaskStatusCode(loggerFactory);

            await result.ExecuteAsync(httpContext);
        }
Ejemplo n.º 6
0
        private async Task GetAsync(HttpContext httpContext)
        {
            var handler = new MyHandler();
            var name    = (string)httpContext.Request.RouteValues["name"];
            var result  = await handler.GetAsync(name);

            await new ObjectResult(result).ExecuteAsync(httpContext);
        }
Ejemplo n.º 7
0
        private async Task Post(HttpContext httpContext)
        {
            var handler = new MyHandler();

            var bodyValue = (JsonDocument)await _reader.ReadAsync(httpContext, typeof(JsonDocument));

            var result = handler.Post(bodyValue);
            await result.ExecuteAsync(httpContext);
        }
Ejemplo n.º 8
0
        private Task StatusCode(HttpContext httpContext)
        {
            var handler     = new MyHandler();
            var statusValue = (string)httpContext.Request.RouteValues["status"];
            int?status      = null;

            if (statusValue != null && Int32.TryParse(statusValue, out var val))
            {
                status = val;
            }

            return(handler.StatusCode(status ?? 0).ExecuteAsync(httpContext));
        }
Ejemplo n.º 9
0
        private Task DoAsync(HttpContext httpContext)
        {
            var handler = new MyHandler();

            return(handler.DoAsync(httpContext, httpContext.Request.Query["q"]));
        }
Ejemplo n.º 10
0
        private Task Blah(HttpContext httpContext)
        {
            var handler = new MyHandler();

            return(new ObjectResult(handler.Blah()).ExecuteAsync(httpContext));
        }
Ejemplo n.º 11
0
        private Task Get(HttpContext httpContext)
        {
            var handler = new MyHandler();

            return(handler.Get(httpContext));
        }