StackExchange / StackExchange/StackExchange.Redis
How to get the second levels of RedisObject?
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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