0
我试图添加一列到以下LINQ表达式。我想让列在一个名为WasteItems的很多表中包含字符串连接的文本值。加入将在“Waste.WasteId = WasteItem.WasteId”上。我的问题是我需要在一个动态列中显示一个字符串,例如“EW(5); EX(3)”,如果WasteItem中有8条记录,并且包含2个字符字符串的列被称为WasteItem.EWC。希望这是有道理的,因为我意识到LINQ是非常强大的,所以必须有一个有效的方法。我是新来的,并不能确定如何启动或去这个问题:LINQTOSQL需要帮助
return from waste in this._db.Wastes
where (from u in _db.UsersToSites.Where(p => p.UserId == userId && p.SystemTypeId == SystemType.W)
select u.SiteId)
.Contains(waste.SiteId)
orderby waste.Entered descending select waste;
在此先感谢