-
Notifications
You must be signed in to change notification settings - Fork 65
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
How to get whole document? #19
Comments
There is no way to retrieve whole JSON as a document/object. Root level properties are documents, so if you want to retrieve settings as a single object, you have to put it under property:
|
@ttu Thanks for the response! May I request a feature to retrieve a whole document then? :) |
Yes, I can add it. How about if I just modify the GetItem-method, so if it is called with empty string as a key, then it would return the whole JSON? var settings = _ds.GetITem<Settings>(string.Empty); |
@ttu There are 3 points why I think it should be done in a different way:
I'd say there should be a dedicated method for getting the whole document. Something like |
Thanks for the input and yes, you are correct. First I was thinking also Have to think this littlebit more, but maybe |
Hello, |
Thanks @AbdulmueezEmiola! This hasn't been fixed/implemented yet. I started some solution, but then forgot this... Pushed the implementation I had done to https://github.com/ttu/json-flatfile-datastore/tree/add-getroot. Commit: 0258e7e Based on what you had in mind you can continue that or if you have some better idea, provide a new solution :) |
If someone does provide a solution for this, it would be appreciated if this could be updated. I just started using this today, got it all worked out and implemented, only to find out I could not simply get all records. : / |
Is there a way to retrieve a whole document, not just some of it's properties or collections?
For a json file from a docs' sample:
How could one retrieve it a as a whole into an instance of a class?
The text was updated successfully, but these errors were encountered: