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);
        }

       

    
    }

  

原文地址:https://www.cnblogs.com/troytian/p/8657367.html