I have s select statement with joining 3 tables which returns something like salary of Individual employees, i want the sum of salary of all employees.
my statement looks like below.
This statement is returning array of Salaries of individual employees, how can i get the SUM ?
var x = (from e in EmpDB.Employees
join d in EmpDB.Departments on e.DepId equals d.Id
join s in EmpDB.EmpSalaries on new { d.Zone, d.Vendor, d.Status } equals new { s.Zone, s.Vendor, s.Status}
where e.Status = "Active" && e.BAID != NULL && e.DepId == 3
select new { s.Salary.Value });
Tried using SUM but not sure about it