EnyimMemcachedCore 2.6.6
.NET 6.0
.NET Standard 2.0
dotnet add package EnyimMemcachedCore --version 2.6.6
NuGet\Install-Package EnyimMemcachedCore -Version 2.6.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EnyimMemcachedCore" Version="2.6.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EnyimMemcachedCore --version 2.6.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EnyimMemcachedCore, 2.6.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EnyimMemcachedCore as a Cake Addin
#addin nuget:?package=EnyimMemcachedCore&version=2.6.6
// Install EnyimMemcachedCore as a Cake Tool
#tool nuget:?package=EnyimMemcachedCore&version=2.6.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Enyim Memcached Client
This is a memcached client library for .NET migrated from EnyimMemcached.
Configure
The appsettings.json Without Authentication
{
"enyimMemcached": {
"Servers": [
{
"Address": "memcached",
"Port": 11211
}
],
"Transcoder": "MessagePackTranscoder"
}
}
The appsettings.json With Authentication
{
"enyimMemcached": {
"Servers": [
{
"Address": "memcached",
"Port": 11211
}
],
"Authentication": {
"Type": "Enyim.Caching.Memcached.PlainTextAuthenticator",
"Parameters": {
"zone": "",
"userName": "username",
"password": "password"
}
}
}
}
Startup.cs
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddEnyimMemcached();
// services.AddEnyimMemcached("enyimMemcached");
// services.AddEnyimMemcached(Configuration);
// services.AddEnyimMemcached(Configuration, "enyimMemcached");
// services.AddEnyimMemcached(Configuration.GetSection("enyimMemcached"));
// services.AddEnyimMemcached(options => options.AddServer("memcached", 11211));
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseEnyimMemcached();
}
}
Example usage
Use IMemcachedClient interface
public class HomeController : Controller
{
private readonly IMemcachedClient _memcachedClient;
private readonly IBlogPostService _blogPostService;
public HomeController(IMemcachedClient memcachedClient, IBlogPostService blogPostService)
{
_memcachedClient = memcachedClient;
_blogPostService = blogPostService;
}
public async Task<IActionResult> Index()
{
var cacheKey = "blogposts-recent";
var cacheSeconds = 600;
var posts = await _memcachedClient.GetValueOrCreateAsync(
cacheKey,
cacheSeconds,
async () => await _blogPostService.GetRecent(10));
return Ok(posts);
}
}
Use IDistributedCache interface
public class CreativeService
{
private ICreativeRepository _creativeRepository;
private IDistributedCache _cache;
public CreativeService(
ICreativeRepository creativeRepository,
IDistributedCache cache)
{
_creativeRepository = creativeRepository;
_cache = cache;
}
public async Task<IList<CreativeDTO>> GetCreatives(string unitName)
{
var cacheKey = $"creatives_{unitName}";
IList<CreativeDTO> creatives = null;
var creativesJson = await _cache.GetStringAsync(cacheKey);
if (creativesJson == null)
{
creatives = await _creativeRepository.GetCreatives(unitName)
.ProjectTo<CreativeDTO>().ToListAsync();
var json = string.Empty;
if (creatives != null && creatives.Count() > 0)
{
json = JsonConvert.SerializeObject(creatives);
}
await _cache.SetStringAsync(
cacheKey,
json,
new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(5)));
}
else
{
creatives = JsonConvert.DeserializeObject<List<CreativeDTO>>(creativesJson);
}
return creatives;
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- MessagePack (>= 2.5.108)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
-
.NETStandard 2.1
- MessagePack (>= 2.5.108)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
-
net6.0
- MessagePack (>= 2.5.108)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
-
net7.0
- MessagePack (>= 2.5.108)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json.Bson (>= 1.0.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
NuGet packages (41)
Showing the top 5 NuGet packages that depend on EnyimMemcachedCore:
Package | Downloads |
---|---|
EasyCaching.Memcached
A simple distributed caching provider based on EnyimMemcachedCore. |
|
Senparc.CO2NET.Cache.Memcached
微信公众账号 - Memcached 模块 Senparc.CO2NET SDK 开源项目: https://github.com/JeffreySu/WeiXinMPSDK |
|
EDQ.WMS.Infrastructrue
Package Description |
|
RsCode.AspNetCore
https://rscode.cn |
|
MT.DotNetCore
MT DotNetCore Common Libs. |
GitHub repositories (5)
Showing the top 5 popular GitHub repositories that depend on EnyimMemcachedCore:
Repository | Stars |
---|---|
dotnetcore/EasyCaching
:boom: EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
|
|
Cysharp/MasterMemory
Embedded Typed Readonly In-Memory Document Database for .NET and Unity.
|
|
grissomlau/jimu
.netcore micro service framework
|
|
Senparc/Senparc.CO2NET
支持 .NET Framework & .NET Core 的公共基础扩展库
|
|
catcherwong/Demos
:100:Some demos for learning
|
Version | Downloads | Last updated |
---|---|---|
2.6.6 | 73,468 | 5/2/2023 |
2.6.5 | 2,045 | 4/28/2023 |
2.6.4 | 94,029 | 1/29/2023 |
2.6.3 | 449 | 1/29/2023 |
2.6.2 | 420 | 1/29/2023 |
2.6.1 | 450 | 1/29/2023 |
2.6.0 | 38,130 | 1/18/2023 |
2.5.7 | 38,972 | 1/1/2023 |
2.5.6 | 146,430 | 11/24/2022 |
2.5.5 | 28,539 | 11/4/2022 |
2.5.4 | 237,262 | 7/3/2022 |
2.5.3 | 1,026,202 | 1/27/2021 |
2.5.2 | 53,271 | 1/3/2021 |
2.5.2-preview1 | 786 | 12/4/2020 |
2.5.1 | 40,151 | 12/2/2020 |
2.5.0 | 1,026 | 12/2/2020 |
2.5.0-preview3 | 507 | 11/30/2020 |
2.5.0-preview2 | 505 | 11/30/2020 |
2.5.0-preview1 | 491 | 11/14/2020 |
2.4.5 | 224,590 | 11/17/2020 |
2.4.4 | 248,766 | 8/25/2020 |
2.4.3 | 205,110 | 3/25/2020 |
2.4.2 | 57,107 | 2/25/2020 |
2.4.1 | 195,161 | 10/16/2019 |
2.4.0 | 142,528 | 9/15/2019 |
2.3.0 | 43,390 | 7/10/2019 |
2.2.4 | 75,406 | 6/15/2019 |
2.2.3 | 12,535 | 5/25/2019 |
2.2.2 | 9,245 | 5/17/2019 |
2.2.0 | 45,834 | 5/16/2019 |
2.1.14 | 16,202 | 5/3/2019 |
2.1.13 | 8,351 | 4/21/2019 |
2.1.12 | 41,119 | 12/31/2018 |
2.1.11 | 1,288 | 12/30/2018 |
2.1.10 | 196,485 | 9/22/2018 |
2.1.9 | 23,872 | 9/16/2018 |
2.1.8 | 62,476 | 6/18/2018 |
2.1.7 | 3,050 | 6/12/2018 |
2.1.5 | 92,819 | 5/30/2018 |
2.1.3 | 1,544 | 5/29/2018 |
2.1.2 | 3,624 | 5/24/2018 |
2.1.1 | 11,441 | 5/23/2018 |
2.1.0.7 | 41,467 | 4/2/2018 |
2.1.0.6 | 1,845 | 3/26/2018 |
2.1.0.5 | 4,481 | 3/8/2018 |
2.1.0.4 | 1,815 | 3/5/2018 |
2.1.0.3 | 1,450 | 3/5/2018 |
2.1.0.2 | 28,285 | 1/19/2018 |
2.1.0.1 | 8,778 | 1/3/2018 |
2.1.0 | 99,494 | 12/15/2017 |
2.0.4 | 1,393 | 12/12/2017 |
2.0.2 | 23,504 | 9/7/2017 |
2.0.1 | 21,151 | 8/19/2017 |
2.0.0 | 5,111 | 8/15/2017 |
2.0.0-beta1 | 2,172 | 7/12/2017 |
1.1.1.12 | 11,256 | 7/8/2017 |
1.1.1.11 | 1,372 | 7/8/2017 |
1.1.1.10 | 7,483 | 5/20/2017 |
1.1.1.9 | 1,433 | 5/20/2017 |
1.1.1.8 | 3,061 | 4/20/2017 |
1.1.1.7 | 6,061 | 3/18/2017 |
1.1.1.6 | 9,727 | 3/16/2017 |
1.1.1.5 | 1,986 | 3/7/2017 |
1.1.1.4 | 1,621 | 3/7/2017 |
1.1.1.3 | 13,049 | 1/2/2017 |
1.1.1.2 | 1,599 | 12/24/2016 |
1.1.1.1 | 2,203 | 12/20/2016 |
1.1.1 | 1,800 | 12/10/2016 |
1.1.0.2 | 1,880 | 12/10/2016 |
1.1.0.1 | 1,677 | 12/8/2016 |
1.1.0 | 1,677 | 12/5/2016 |
1.0.0.8 | 6,191 | 11/11/2016 |
1.0.0.7-preview1 | 1,384 | 10/26/2016 |
1.0.0.6 | 4,920 | 10/20/2016 |
1.0.0.5 | 1,529 | 10/19/2016 |
1.0.0.4 | 1,541 | 10/18/2016 |
1.0.0.3 | 1,549 | 10/13/2016 |
1.0.0.2 | 1,567 | 9/27/2016 |
1.0.0.1 | 1,601 | 9/26/2016 |
1.0.0 | 2,037 | 3/25/2016 |