
Code:
To return the average value from a Numeric Sequence .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQ
{
class Program
{
static void Main(string[] args)
{
DataClassesDataContext dc = new DataClassesDataContext();
var empQuery = (from emp in dc.EmpDetails
select emp.Allowance).Average();
Console.WriteLine(empQuery.Value);
Console.Read();
}
}
}

Join the conversation! Your thoughts help the community grow.