在 web api 中,不使用的数据.ToList()
也发送到 api,但是如何?这是我的 LINQ 查询,我不使用,.ToList()
但我的数据也发送到浏览器。谁能告诉我区别或描述它是如何工作的?
using (var _context = new iCMEFModelCon())
{
return _context.UserResidents.Where(c => c.ResidentId == residentId)
.Select(c => new
{
UserId = c.User.Id,
UserName = ((c.User.FirstName ?? "") + " " + (c.User.LastName ?? "")).Trim()
});
}