-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
InMemoryCacheClient can not get as object #133
Comments
When ever you are doing a get of a reference type, we make a complete clone of the object and return it. So when you say Were you thinking you'd get a copy back as type T? |
I want set a T,but get as object,but it not work well. |
you can copy the code and run this case .it is failed |
Would you mind doing a pr for this support as well as add the test. Currently we are using the DeepCloner library.. I wonder if there is something we can do to preserve the type. |
you can copy the code i given at the first and run it in you test project. in my project ,has use you in memoryclient code and fixed this problem. only delete code in the red box in the picture |
The object is serialized and deserialized. We need to know what datatype to deserialize to. We could always wrap the data in an envelope with type information embedded into it, but not sure how I feel about that. Remember that you are just looking at the in memory implementation there are implementations in Redis and others as well that need to be taken into consideration. |
this is the unit test
in the CacheValue .GetValue method , you judge the T as object made this problem . i think you can delete this judgement.
or what is your reason for that
The text was updated successfully, but these errors were encountered: