-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
InvalidCastException for DeserializeDictionary when Key is of type Guid #546
Comments
Hi @prajaybasu, it's not possible use Dictionary with non string TKey because each key must be a valid key in JSON (and must be a string). You can change your Dictionary to a List or you can implement your custom serialization to this Dictionary instance, using |
I suppose it does convert other |
Agree with @prajaybasu here, if some simple modification could expand the usability that would be worth it. http://stackoverflow.com/questions/393731/generic-conversion-function-doesnt-seem-to-work-with-guids |
I've got the same issue... When is this fixed? |
Might be better to rename this issue to something like "InvalidCastException for DeserializeDictionary when Key is of non primitive or string type" |
as a side note, you could just serialize the key and then handle the deserialization of keys somehow here Using Json.NET for this in particular does allow this to work though. |
Hi! With the objective of organizing our issues, we are closing old unsolved issues. Please check the latest version of LiteDB and open a new issue if your problem/question/suggestion still applies. Thanks! |
@lbnascimento so you are officially abandoning support for v4 now? |
Hi @omfgicbf, v4 will be maintained only for bugs and critical updates. Any new feature will be applied only in v5 (it's too hard keep both in evolution) |
This issue is due to the fact that BsonDocument only supports |
Unfortunately, due to the fact that |
Stack trace :
Data Type :
Method Call :
I think it's throwing because Generic conversion doesn't support GUIDs.
Platform : ASP.NET Core 1.1.0 on .NET Core 1.1.0 using .NET Core SDK
1.0.0-preview2-1-003177
Edit : I got it working by forking and using a very quick-and-dirty fix in
DeserializeDictionary()
So basically right now you can't have Guid as a TKey in an IDictionary
The text was updated successfully, but these errors were encountered: