我有两张桌子
视频
注释
我想加入并使用LINQ获得视频的平均评分
我该怎么做?
答案 0 :(得分:2)
var query = from video in Video join
comment in Comment on comment.VideoId equals video.VideoId;
Console.WriteLine("Average Rating: " + query
.Where(i => i.VideoName = videoName)
.Average(i => i.Rating));