I am trying to transfer a simple memcached client from .NET 4 to .Net Core on AWS Lambda. I am trying to set up a new EnyimMemcachedCore client because the examples ( https://github.com/cnblogs/EnyimMemcachedCore ) use appsettings.json to configure, but the Lambda functions use .net does not use appsettings.json. I need to configure server / port / endpoint in C # code.
Can someone give me an example using EnyimMemcachedCore, which creates the configuration manually?
The standard use of Enny Ennet was trivial to fetch by key and return a value:
using Enyim.Caching;
using Enyim.Caching.Configuration;
using Enyim.Caching.Memcached;
...
MemcachedClient myCache;
MemcachedClientConfiguration config;
config = new MemcachedClientConfiguration();
config.AddServer("theIP", thePort);
config.Protocol = MemcachedProtocol.Text;
myCache = new MemcachedClient(config);
var result = myCache.Get(key);
How do I do something like this (configure the memcached client in code, not in the configuration file) with EnyimMemcachedCore?