From 9c54d73beeb64fe9021573751e5fb98cb2aeec95 Mon Sep 17 00:00:00 2001 From: diegotrujillor Date: Mon, 5 Mar 2018 10:06:18 -0500 Subject: [PATCH] Update memory.md (#5596) * Update memory.md Just a typo, I changed the work time by "item" in the `TryGetValue` section. * Update memory.md * Additional updates --- aspnetcore/performance/caching/memory.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/performance/caching/memory.md b/aspnetcore/performance/caching/memory.md index fb4fc0cb8b..dfb6014507 100644 --- a/aspnetcore/performance/caching/memory.md +++ b/aspnetcore/performance/caching/memory.md @@ -41,15 +41,15 @@ Request the `IMemoryCache` instance in the constructor: `IMemoryCache` requires NuGet package "Microsoft.Extensions.Caching.Memory". -The following code uses [TryGetValue](https://docs.microsoft.com/aspnet/core/api/microsoft.extensions.caching.memory.imemorycache#Microsoft_Extensions_Caching_Memory_IMemoryCache_TryGetValue_System_Object_System_Object__) to check if the current time is in the cache. If the item isn't cached, a new entry is created and added to the cache with [Set](https://docs.microsoft.com/aspnet/core/api/microsoft.extensions.caching.memory.cacheextensions#Microsoft_Extensions_Caching_Memory_CacheExtensions_Set__1_Microsoft_Extensions_Caching_Memory_IMemoryCache_System_Object___0_). +The following code uses [TryGetValue](/dotnet/api/microsoft.extensions.caching.memory.imemorycache.trygetvalue?view=aspnetcore-2.0#Microsoft_Extensions_Caching_Memory_IMemoryCache_TryGetValue_System_Object_System_Object__) to check if a time is in the cache. If a time isn't cached, a new entry is created and added to the cache with [Set](/dotnet/api/microsoft.extensions.caching.memory.cacheextensions.set?view=aspnetcore-2.0#Microsoft_Extensions_Caching_Memory_CacheExtensions_Set__1_Microsoft_Extensions_Caching_Memory_IMemoryCache_System_Object___0_Microsoft_Extensions_Caching_Memory_MemoryCacheEntryOptions_). [!code-csharp[](memory/sample/WebCache/Controllers/HomeController.cs?name=snippet1)] -The current time and the cached time is displayed: +The current time and the cached time are displayed: -[!code-html[](memory/sample/WebCache/Views/Home/Cache.cshtml)] +[!code-cshtml[](memory/sample/WebCache/Views/Home/Cache.cshtml)] -The cached `DateTime` value will remain in the cache while there are requests within the timeout period (and no eviction due to memory pressure). The image below shows the current time and an older time retrieved from cache: +The cached `DateTime` value remains in the cache while there are requests within the timeout period (and no eviction due to memory pressure). The following image shows the current time and an older time retrieved from the cache: ![Index view with two different times displayed](memory/_static/time.png)