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

Add support for deserialization of IEnumerable #92

Closed
michal-novak-pos-digital opened this issue Dec 30, 2015 · 2 comments
Closed

Add support for deserialization of IEnumerable #92

michal-novak-pos-digital opened this issue Dec 30, 2015 · 2 comments
Milestone

Comments

@michal-novak-pos-digital
Copy link
Contributor

Please add support for deserialization of IEnumerable in similar way as XmlSerializer does.
See remarks about IEnumerable https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer(v=vs.110).aspx

It would be great to keep compatible behavior.
Anyway this method crashes when target collection is derived from List

You can use attached implemetation.
Deseriaize.txt

@mbdavid mbdavid added this to the v2.0.0 milestone Dec 30, 2015
@mbdavid
Copy link
Collaborator

mbdavid commented Dec 31, 2015

Hi @michal-novak-pos-digital, thanks for your contribution. I use your implementation for IEnumerable changing the way how get itemType (your way doest work on my unit tests). Can you test this last commit?

@michal-novak-pos-digital
Copy link
Contributor Author

Thank you very much for including this enhacement int your project.

But there still is one issue.
When type derived from IEnumerable<>, ICollection<>, or IList<>, etc.. is used deserialization fails.
Please see my pull request.

My solution failed when IEnumerable<> was used directly, but yours failed as described above.
So this would make this problem solved for both cases.

github-actions bot pushed a commit to Reddevildragg-UPM-Forks/LiteDB that referenced this issue Nov 18, 2020
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