在 linq 中加入两个查询的最佳方法是什么?目前我的代码没有将它们连接在一起。
var userprofilemodel1 =
(from u in db.UserProfiles
where u.UserId == 1
orderby u.FirstName, u.LastName
select new UserListViewModel
{
UserId = u.UserId,
UserName = u.UserName,
FirstName = u.FirstName,
LastName = u.LastName,
DocumentCount = u.Documents.Count
}).ToPagedList(page, 10);
var userprofilemodel2 =
(from u in db.UserProfiles
where u.UserId == 18
orderby u.FirstName, u.LastName
select new UserListViewModel
{
UserId = u.UserId,
UserName = u.UserName,
FirstName = u.FirstName,
LastName = u.LastName,
DocumentCount = u.Documents.Count
}).ToPagedList(page, 10);
userprofilemodel1.Concat(userprofilemodel2);