.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections.Generic;
using Facebook;

					
public class Program
{
	public void Main()
    {
		var client = new FacebookClient();
			
		for (int i=1; i <= 10; i++)
		{
			try
			{
				var userInfo = (IDictionary<string,object>)client.Get(i.ToString());  	//Roslyn currently doesn't support dynamic, so using Dictionary instead
				Console.WriteLine("ID: " + i + ".  " + userInfo["name"]); 
			}
			catch
			{
				Console.WriteLine("ID: " + i + ".  Does not exist");
			}
		}		
    }
}
;