Remove async keyword and return completed task

This commit is contained in:
Kiran Challa 2017-05-02 12:56:05 -07:00
parent e7b403adee
commit 35cd198d9b
1 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.Extensibility; using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -28,7 +29,7 @@ namespace IISSample
var logger = loggerFactory.CreateLogger("Requests"); var logger = loggerFactory.CreateLogger("Requests");
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
app.Map("/log", logApp => logApp.Run(async (context) => app.Map("/log", logApp => logApp.Run((context) =>
{ {
TelemetryConfiguration.Active.TelemetryChannel = new CurrentResponseTelemetryChannel(context.Response); TelemetryConfiguration.Active.TelemetryChannel = new CurrentResponseTelemetryChannel(context.Response);
@ -53,6 +54,8 @@ namespace IISSample
specificLogger.LogWarning("Specific warning log"); specificLogger.LogWarning("Specific warning log");
TelemetryConfiguration.Active.TelemetryChannel = null; TelemetryConfiguration.Active.TelemetryChannel = null;
return Task.FromResult(true);
})); }));
app.Run(async (context) => app.Run(async (context) =>
{ {