This library extended the functionality of IDistributedCache
interface to make the caching mechanism more easier in .NET 5.0 and .NET Core.
First install the lastest version of TanvirArjel.Extensions.Microsoft.Caching
nuget package into your project as follows:
Install-Package TanvirArjel.Extensions.Microsoft.Caching
using TanvirArjel.Extensions.Microsoft.Caching
// To set
Employee employee = new Employee
{
Id = 1,
Name = "Tanvir"
};
string cacheKey = "Employee1";
await _distributedCache.SetAsync<Employee>(cacheKey, employee);
// To retrive
Employee = await _distributedCache.GetAsync<Employee>(cacheKey);
GetAsync<T>()
SetAsync<T>()
- 3 overloadsAddToListAsync<T>()
- 3 overloadsAddToListAsync<T, TKey>()
- 3 overloadsUpdateInListAsync<T>()
- 3 overloadsUpdateInListAsync<T, TKey>()
- 3 overloadsRemoveFromListAsync()
- 3 overloads
Dont forget to submit an issue if you face. we will try to resolve as soon as possible.
If you find this library useful to you, please don't forget to encouraging me to do such more stuffs by giving a star (⭐) to this repository. Thank you.