How can you find average of student marks from student tables (columns are studentid, marks)?
Answer / 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 |
What is lambda expression in linq?
How standard query operators useful in linq?
what is the difference between N-layer and N-tier architecture in LINQ?
What is difference between linq and sql entity framework?
Is linq a programming language?
What is difference between linq and entity framework?
what is LINQ? Why is it required?
Explain how LINQ is useful than Stored Procedures?
Which command-line tool generates code and mapping for the LINQ to SQL component of .NET Framework?
What is difference between linq and lambda expression?
What is a lambda expression?
Explain what is select clause and where clause in linq?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)