c# - Correct way to use StackExchange.Redis in WebApi -
i want add counters several c# webapi controllers using redis , stackexchange.redis client.
i have never used redis before, however, have read docs, setup server , appears straightforward results looking for.
having read stackexchange.redis docs, concerned following...
connectionmultiplexer lot, designed shared , reused between callers. should not create connectionmultiplexer per operation.
i have googled , found several examples simple c# console apps (the technique here obvious not relevant webapi), have found examples of using stackexchange.redis client on microsoft pages, emphasize importance of sharing connectionmultiplexer, after hours, still no further forwards in understanding how achieve in c# .net webapi
would kind enough point me in right direction?
i need make simple calls redis, namely incr counter 1, decr counter 1 , getset counter 0 (to reset)
as counters not critical, want ensure if reason connection redis server unavailable code continues in timely manner.
many thanks
rich
Comments
Post a Comment