How can you find average of student marks from student tables (columns are studentid, marks)?
Answer Posted / Vinay Sharma
You can use LINQ to calculate the average of student marks by using the Average() method in combination with From clause and the Where clause to filter the records. Here's an example: `var averageMarks = dbContext.Students.Where(student => student.StudentId > 0).Average(student => student.Marks);`
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category