Ejemplo n.º 1
0
        public HomeModule(IGreeterService greeter)
        {
            Get("/", args =>
            {
                return(View["index.html", greeter.GetGreeting()]);
            });

            Get("/test", args => greeter.GetGreeting());

            Get("/os", x =>
            {
                return(System.Runtime.InteropServices.RuntimeInformation.OSDescription);
            });
        }
Ejemplo n.º 2
0
        public HomeModule(IGreeterService greeter)
        {
            //https://blog.nandotech.com/post/2016-10-25-nancyfx-webapi-dapper/


            Get("/", args =>
            {
                return(greeter.GetGreeting());
            });

            Get("/test", args => greeter.GetGreeting());

            Get("/os", x =>
            {
                return(System.Runtime.InteropServices.RuntimeInformation.OSDescription);
            });
        }
Ejemplo n.º 3
0
        public Task <IHttpResponse> ExecuteAsync(HttpContext context)
        {
            IHttpResponse response = new StringResponse(context, _greeterService.GetGreeting());

            return(Task.FromResult(response));
        }