Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3 from thewahome/patch-1
check if people-near-me has results
  • Loading branch information
jasonjoh committed Dec 13, 2018
2 parents 33edede + 04df7b0 commit bb468d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Demos/01-console-application/README.md
Expand Up @@ -251,10 +251,11 @@ The methods we created use the **async/await** pattern.
Console.WriteLine("Get People Near Me");

var peopleJson = await GetPeopleNearMe();
dynamic people = JObject.Parse(peopleJson);
if(null != people)

if (!string.IsNullOrEmpty(peopleJson))
{
foreach(var p in people.value)
dynamic people = JObject.Parse(peopleJson);
foreach (var p in people.value)
{
var personType = p.personType;
Console.WriteLine("Object:{0}\t\t\t\tClass:{1}\t\tSubclass:{2}", p.displayName, personType["class"], personType.subclass);
Expand Down
7 changes: 4 additions & 3 deletions Demos/01-console-application/src/ConsoleApp/Program.cs
Expand Up @@ -85,10 +85,11 @@ static async Task RunAsync()
Console.WriteLine("Get People Near Me");

var peopleJson = await GetPeopleNearMe();
dynamic people = JObject.Parse(peopleJson);
if(null != people)

if (!string.IsNullOrEmpty(peopleJson))
{
foreach(var p in people.value)
dynamic people = JObject.Parse(peopleJson);
foreach (var p in people.value)
{
var personType = p.personType;
Console.WriteLine("Object:{0}\t\t\t\tClass:{1}\t\tSubclass:{2}", p.displayName, personType["class"], personType.subclass);
Expand Down

0 comments on commit bb468d7

Please sign in to comment.