How to save redis in a specific file at asp.net core -


i using "microsoft.extensions.caching.redis.core": "1.0.3", in statup.cs write follow code `

public void configureservices(iservicecollection services){ services.adddistributedrediscache(options =>      {            options.instancename = "sample";              options.configuration ="11.11.22.24:6379,password=*****";      }); } 

`
, in controller.cs write follow code

_distributedcache.setstring("hellofromredis", "world"); var valuefromredis = _distributedcache.getstring("hellofromredis"); 

on redis server data this how save data in db1


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -