2
Answers

How to write Linq query for count salary

Hello Friends,
 
In my database, I have a colum Salary with numeric(18,0)
I want to write code for getting total employee salary 
For example;  select couunt(*) from Employee
 
select Department,count(*) from Employee group by Department 
 
Here I wrote; 
  1. var count = db.Employees.Count(x => Convert.ToBoolean(x.Salary));  
But,Im getting error. please help me to solve 
Answers (2)