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

FS Gedcomx property and data loading #41

Open
weitzhandler opened this issue Jan 23, 2017 · 4 comments
Open

FS Gedcomx property and data loading #41

weitzhandler opened this issue Jan 23, 2017 · 4 comments

Comments

@weitzhandler
Copy link
Contributor

Hi,

I am new to the API and I was wondering whether all the classes in the API (let's say PersonState) store genealogy info (in properties), or are just a means for request data, but not to be used as entity classes.

It's just that I still didn't manage to load current user as a person record along with its birth date and some other conclusions.

Here's my code:

var uri = new Uri("https://integration.familysearch.org/platform/collections/tree");
var tree = new FamilySearchFamilyTree(uri);
var state = tree.AuthenticateViaOAuth2Password(Username, Password, ClientId);

Debug.Assert(state.IsAuthenticated);
var current = tree.ReadPersonForCurrentUser();
var name = current.GetName(); //null
var conclusion = current.GetConclusion(); //null
var conclusions = current.LoadConclusions();

Now my question is what's next? Why is the name and conclusion field null, if the tree looks like so:

Here's a screenshot of what I see in my debugger for the variable conclusions:

@wooddani
Copy link

wooddani commented Jan 23, 2017 via email

@weitzhandler weitzhandler changed the title Gedcomx FS Gedcomx property and data loading Jan 24, 2017
@weitzhandler
Copy link
Contributor Author

Hi,
After some digging into the examples, I admit I should have done it earlier. I now learned that the SDK uses fluent API style to construct things.
Anyway, my question still remains, how do I get from a PersonState to a Person.
Considering my code above why does this evaluate to null:

var uri = new Uri("https://integration.familysearch.org/platform/collections/tree");
var tree = new FamilySearchFamilyTree(uri);
var state = tree.AuthenticateViaOAuth2Password(Username, Password, ClientId);
Debug.Assert(state.IsAuthenticated);
var current = tree.ReadPersonForCurrentUser();
var person = current.Person; //null

@stoicflame
Copy link
Member

There must have been some kind of error, or the SDK didn't correctly follow the redirect.

@weitzhandler
Copy link
Contributor Author

Can you help me trace the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants