How do I handle async operations in Startup.Configure?
问题 In my ASP.NET 5 app, I want to load some data from Azure into a cache inside my Startup.Configure method. The Azure SDK exposes async methods exclusively. Typically, calling an async method is done via await inside an async method, like this: public async Task Configure(IApplicationBuilder app, IMemoryCache cache) { Data dataToCache = await DataSource.LoadDataAsync(); cache.Set("somekey", dataToCache); // remainder of Configure method omitted for clarity } However, ASP.NET 5 requires that the