From 56cb898bdeac5fb897b92e38ad708e6d01e79543 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 16 Aug 2016 13:57:37 -0700 Subject: [PATCH] Rename PrimeCache to PrimeCacheAsync (keeping older name as obsolete overload). Fixes #246. --- samples/angular/MusicStore/Views/Home/Index.cshtml | 4 ++-- .../PrimeCacheHelper.cs | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/samples/angular/MusicStore/Views/Home/Index.cshtml b/samples/angular/MusicStore/Views/Home/Index.cshtml index 9ac9f01..a2799f7 100755 --- a/samples/angular/MusicStore/Views/Home/Index.cshtml +++ b/samples/angular/MusicStore/Views/Home/Index.cshtml @@ -4,8 +4,8 @@ Loading... - @await Html.PrimeCache(Url.Action("GenreMenuList", "GenresApi")) - @await Html.PrimeCache(Url.Action("MostPopular", "AlbumsApi")) + @await Html.PrimeCacheAsync(Url.Action("GenreMenuList", "GenresApi")) + @await Html.PrimeCacheAsync(Url.Action("MostPopular", "AlbumsApi")) @section scripts { diff --git a/src/Microsoft.AspNetCore.AngularServices/PrimeCacheHelper.cs b/src/Microsoft.AspNetCore.AngularServices/PrimeCacheHelper.cs index 1b01662..388ab06 100644 --- a/src/Microsoft.AspNetCore.AngularServices/PrimeCacheHelper.cs +++ b/src/Microsoft.AspNetCore.AngularServices/PrimeCacheHelper.cs @@ -11,9 +11,15 @@ namespace Microsoft.AspNetCore.AngularServices { public static class PrimeCacheHelper { - public static async Task PrimeCache(this IHtmlHelper html, string url) + [Obsolete("Use PrimeCacheAsync instead")] + public static Task PrimeCache(this IHtmlHelper html, string url) { - // TODO: Consider deduplicating the PrimeCache calls (that is, if there are multiple requests to precache + return PrimeCacheAsync(html, url); + } + + public static async Task PrimeCacheAsync(this IHtmlHelper html, string url) + { + // TODO: Consider deduplicating the PrimeCacheAsync calls (that is, if there are multiple requests to precache // the same URL, only return nonempty for one of them). This will make it easier to auto-prime-cache any // HTTP requests made during server-side rendering, without risking unnecessary duplicate requests.