写个文章试试编辑器

Code
public IQueryable<Profile> GetFriends(long userid) {
var ret
= (from f1 in DBExt.DB.Friend
join p1
in DBExt.DB.Profile on f1.ToID equals p1.UserID
where f1.FromID == userid
select p1)
.Union(from f1
in DBExt.DB.Friend
join p1
in DBExt.DB.Profile on f1.FromID equals p1.UserID
where f1.ToID == userid
select p1)
.Select(c
=> new Profile {
UserID
= c.UserID,
Name
= c.Name,
ShowText
= c.ShowText,
ShowTextTime
= c.ShowTextTime
});
return ret;
}

posted @ 2008-09-01 00:36  重典  阅读(155)  评论(0编辑  收藏  举报