Esempio n. 1
0
        public LogModule(IRavenClient ravenClient)
        {
            Get["/log"] = _ =>
            {
                var messageId = ravenClient.CaptureMessage("Hello world !!!");
                return View["log.html", new { MessageId = messageId }];
            };

            Get["/log-async", runAsync : true] = async (_, token) =>
            {
                var httpClient = new HttpClient();
                var response = await httpClient.GetAsync("http://www.google.com");

                response.EnsureSuccessStatusCode();

                var result = await response.Content.ReadAsStringAsync();
            #if (!net40)
                var messageId = await ravenClient.CaptureMessageAsync("Hello world!!!");
            #else
                var messageId = ravenClient.CaptureMessage("Hello world!!!");
            #endif

                return View["log.html", new { MessageId = messageId }];
            };
        }
Esempio n. 2
0
        public LogModule(IRavenClient ravenClient)
        {
            Get["/log"] = _ =>
            {
                var messageId = ravenClient.CaptureMessage("Hello world !!!");
                return(View["log.html", new { MessageId = messageId }]);
            };

            Get["/log-async", runAsync : true] = async(_, token) =>
            {
                var httpClient = new HttpClient();
                var response   = await httpClient.GetAsync("http://www.google.com");

                response.EnsureSuccessStatusCode();

                var result = await response.Content.ReadAsStringAsync();

                #if (!net40) && (!net35)
                var messageId = await ravenClient.CaptureMessageAsync("Hello world!!!");
                #else
                var messageId = ravenClient.CaptureMessage("Hello world!!!");
                #endif

                return(View["log.html", new { MessageId = messageId }]);
            };
        }
Esempio n. 3
0
        public LogModule(IRavenClient ravenClient)
        {
            Get["/log"] = _ =>
            {
                var messageId = ravenClient.CaptureMessage("Hello world !!!");
                return(View["log.html", new { MessageId = messageId }]);
            };

            #if (!NET40) && (!NET35)
            Get["/log-async", runAsync : true] = async(_, token) =>
            #else
            Get["/log-async"] = (_) =>
            #endif
            {
                #if (!NET40) && (!NET35)
                var messageId = await ravenClient.CaptureMessageAsync("Hello world!!!");
                #else
                var messageId = ravenClient.CaptureMessage("Hello world!!!");
                #endif

                return(View["log.html", new { MessageId = messageId }]);
            };
        }