I am using LINQ-to-SQL and I also have resharper. In the repository I have a line:
IList<Employee> employees = DataContext.Employees.Where(emp => emp.CompanyID == companyID).ToList();
Where Payroll is an Entity.
Below I have a line:
if(employees! = null && employees.Count > 0)
{
///TODO:
}
Resharper says payrolls cannot be equal to null.
If there is no match for companyId , wont employees be null. Can ayone throw more light on wh resharper says so??
If there is no match for companyId LINQ will return an empty Enumerable, it never will be null.