LINQ to FQL (Facebook Query Language)


LINQ to FQL is an open source project, sources, binaries and samples can be found at CodePlex. This library extends the Facebook Developer Toolkit.


This library enables developers to use LINQ (.NET Language-Integrated Query) with Facebook instead of string based FQL queries. The main benefits for using this library are:

  • Type safety: queries are now typed and their syntax is verified during compilation.
  • Auto-complete now function when composing queries in Visual Studio.
  • Using Facebook / anonymous objects for query results.

Example: this following sample code retrieves the names and pictures of all of your friends.

var db = new FacebookDataContext();
var friendIDs = from friend in db.friend_info where friend.uid1 == db.uid select friend.uid2;
var friendDetails = from user in db.user where friendIDs.Contains(user.uid) select new { Name =, Picture = user.pic_small };

Via CodeProject: LINQ to FQL (Facebook Query Language). Free source code and programming help


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s