StackExchange / StackExchange/StackExchange.Redis

How to get the second levels of RedisObject?

Open
#2,377 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

⚙️ area:API
Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Greetings, I'm currently facing an issue.

I'm using execute to get ACL GETUSER and I am trying to parse the value of the permissions. This is to check they are correct.

I have this so far:

var getACL = db.Execute("ACL", "GETUSER", mac);
var acl = getACL.ToDictionary().FirstOrDefault(c => c.Key == "selectors").Value;
var aclSelectors = acl.ToDictionary();

Except, the problem is that acl.ToDictionary() returns an error saying System.InvalidCastException: 'Specified cast is not valid.'

What's the appropriate way to get the values?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Execute call and the ToDictionary conversions shown in the report; inspect the returned RedisObject shape for ACL GETUSER, especially selectors. Confirm the supported conversion for nested values and document or test the appropriate access pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.