0

嗨,我有两个不同的查询,一个是用于username,第二个是用于检索Messagesactor_id

那么我如何结合查询并获得正确的结果。我的查询喜欢。

var Query1 = fbApp.Query("SELECT uid, name, pic_square FROM user WHERE uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())");

var newsFeed = fbApp.Query("SELECT post_id, actor_id, target_id, message FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND is_hidden = 0");

谢谢你..!!

4

1 回答 1

-2

The Enumerable.Union method allows you to combine both results (provided both return an enumeration of the same type). Enumerable.Intersect can help you find only users that exist in both lists.

From MSDN:

int[] ints1 = { 5, 3, 9, 7, 5, 9, 3, 7 };
int[] ints2 = { 8, 3, 6, 4, 4, 9, 1, 0 };

IEnumerable<int> union = ints1.Union(ints2);

foreach (int num in union)
{
     Console.Write("{0} ", num);
}
/*
This code produces the following output:

5 3 9 7 8 6 4 1 0
*/

So for you something like this:

var combinedList = Query1.Union(newsFeed);
于 2011-12-28T15:08:42.060 回答