-
Notifications
You must be signed in to change notification settings - Fork 57
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
I need to insert geo coordinates inside context #33
Comments
Unfortunately there is not currently an interface for adjusting the extensions map on existing objects. This is definitely an oversight in the API. For now I think you would have to work around this by passing the full list of extension properties during construction of the object. You can pass it a The TinCanJava object that is effectively the same has added an interface for manipulating the Extensions object, you can see it starting here: When we get around to adding this interface to TinCan.NET it will very likely look the same. If you want to do that and submit a clean PR (IOW no extraneous changes to the .proj, etc.) then it will eventually get included. I can't give a timeframe on review+merge. |
All right I could try to run with Object, because I really have this:
"context": {
"extensions": {},
so…if I grab this like a Object with ToJObject method, I have…empty could edit with my values…and then?
How could I pass back to the specific statement?
Could you provide me an example in c#
Thanks and regards
Andrea
… Il giorno 19 gen 2018, alle ore 14:26, Brian J. Miller ***@***.***> ha scritto:
ToJObject
|
@brianjmiller @uest555 I have been trying to add extensions to my statements without any luck. I did this: To add to the extension, I tried what @brianjmiller suggested.
Doing the above I get this error: It seems that it is looking for a different version of Newtonson.Json. I've been looking around but it seems that it does not exist. Any help would be great. Thanks. |
Nevermind. I realized I was using an older version of Newtonsoft.Json. I updated it and it worked perfectly. @uest555 I know this is a very old post but this worked for editing your extensions.
|
Ooooh …sooooo many thanks!!!!!!!!!!!!!!!!!!!
… Il giorno 19 ago 2020, alle ore 03:22, Jonathan Valderrama ***@***.***> ha scritto:
Nevermind. I realize I was using an older version of Newtonsoft.Json. I updated it and it worked perfectly.
@uest555 <https://github.com/uest555> I know this is a very old post but this worked for editing your extensions.
JObject extensionsObject = new JObject();
extensionsObject.Add("http://id.tincanapi.com/extension/duration", value);
statement.result.extensions = new TinCan.Extensions(extensionsObject);
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#33 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AD2RBP6RMXOU6OVKQTXMCT3SBMSMNANCNFSM4EMRDTUQ>.
|
Hi,
I'm trying to insert gps positions as Extensions into Context Object.
When I call the object i can't find how to insert the values.
This is the code I use to write a context part in the statement
var objContext = new Context();
objContext.extensions = new TinCan.Extensions();
how can now insert the user gps positions?
"http://id.tincanapi.com/extension/latitude" = userLatCoord;
"http://id.tincanapi.com/extension/longitude" = userLongCoord;
Thanks in advance...
Andrea
The text was updated successfully, but these errors were encountered: