© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
PAN1K

Json Serializer implicit conversion

I'm trying to implement a
GetAsync<T>(CacheKey key)
GetAsync<T>(CacheKey key)
method for Redis.

The issue is that when T is string the method can't deserialize the value to string, as the value is already a string.

I can do an if check for string type but I wonder if there is another way
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

✅ CSharpFunctionalExtensions.Result implicit conversion
C#CC# / help
2y ago
Convert enclosing type - implicit enum conversion
C#CC# / help
2y ago
Custom JSON serializer not working
C#CC# / help
4y ago
❔ Adding logic into a JSON serializer
C#CC# / help
4y ago