Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisResult - method to get the Type #21

Closed
ghost opened this issue Apr 17, 2014 · 4 comments
Closed

RedisResult - method to get the Type #21

ghost opened this issue Apr 17, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2014

Mark I've converted a BookSleeve project to SE.redis - so far so good. I use Lua scripts. One minor thing I ran into was a couple of my scripts return different types depending on inputs - e.g., a script that might return an int, null or byte[]. With BookSleeve's Eval, you could use is semantics - e.g., if (ret is Int64). With RedisResult, you wrap the returned object within the internals of the class with cast operators. So the only way I can distinguish is to cast and deal with InvalidCastException (although you do have an IsNull property). Would you consider adding some sort of Is(Type) function of something along those lines?

@mgravell
Copy link
Collaborator

That makes absolute sense. I'll take a look.
On 17 Apr 2014 20:36, "jeff anderson" [email protected] wrote:

Mark I've converted a BookSleeve project to SE.redis - so far so good. I
use Lua scripts. One minor thing I ran into was a couple of my scripts
return different types depending on inputs - e.g., a script that might
return an int, null or byte[]. With BookSleeve's Eval, you could use is
semantics - e.g., if (ret is Int64). With RedisResult, you wrap the
returned object within the internals of the class with cast operators. So
the only way I can distinguish is to cast and deal with
InvalidCastException (although you do have an IsNull property). Would you
consider adding some sort of Is function of something along those lines?


Reply to this email directly or view it on GitHubhttps://github.com//issues/21
.

@ghost
Copy link
Author

ghost commented Apr 18, 2014

Marc - many thanks

@NickCraver NickCraver changed the title RedisResult RedisResult - method to get the Type Jan 25, 2016
@NickCraver
Copy link
Collaborator

Added to the 2.x backlog

@NickCraver NickCraver added this to the 2.0 milestone May 28, 2018
mgravell added a commit that referenced this issue Jul 9, 2018
@mgravell
Copy link
Collaborator

mgravell commented Jul 9, 2018

Implemented in 2.0

@mgravell mgravell closed this as completed Jul 9, 2018
philon-msft added a commit that referenced this issue Oct 9, 2021
Merge latest changes from StackExchange.Redis repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants