Get Average Using LINQ

double RatingAverage = ctx.Rates.Where(r => r.Id == Id).Average(r => r.Rating);

Leave a Comment