---
title: "Discussion on \"Cache Implementation in .NET 4.8\" | Hashnode"
description: "Discussion on \"Cache Implementation in .NET 4.8\". if (Cache[\"total_\"+ userId] == null)\n{\n    /* 30 minutes cache*/\n    Cache.Insert(\"total_\" + userId\n        , dc.Customers.Where(p => p.UserId == userId).Count()\n        , null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);\n}\ntotal = (int) Cache[\"tota..."
url: "https://hashnode.com/posts/cache-implementation-in-net-48/647616827fd187fd8e7a043d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Cache Implementation in .NET 4.8](https://karatas.dev/cache-implementation-in-net-48?utm_source=hashnode&utm_medium=feed)

if (Cache\["total\_"+ userId\] == null) { /\* 30 minutes cache\*/ Cache.Insert("total\_" + userId , dc.Customers.Where(p => p.UserId == userId).Count() , null, DateTime.Now.AddMinutes(30), TimeSpan.Zero); } total = (int) Cache\["tota...

May 30, 2023 · 1 min read · karatas.dev  
Read the article

-   [#caching](https://hashnode.com/tag/caching)

## Written by

[Ferhat Karataş](https://hashnode.com/@karatas)

@karatas · Turkey

  
[View profile](https://hashnode.com/@karatas)

Software Developer

Performance freak

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
