await和async在C#一般处理程序(ashx)中的使用
public class hello : HttpTaskAsyncHandler, IReadOnlySessionState { public IFetchServise fetch { get; set; } public override async Task ProcessRequestAsync(HttpContext context) { context.Response.ContentType = "text/plain"; var name = await fetch.RandomFortuneAsync(); context.Response.Write(name); } }