forked from ericgu/DesignForTestability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmployeeDAL.cs
32 lines (27 loc) · 853 Bytes
/
EmployeeDAL.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using designIssueExample.Filters;
using System;
using System.Collections.Generic;
namespace designIssueExample
{
class EmployeeDAL
{
public IEnumerable<Employee> GetEmployees(EmployeeFilter filter)
{
if (filter == null)
{
throw new ArgumentNullException("filter");
}
string query = "select * from employee, employee_role inner join employee.Id == employee_role.EmployeeId";
List<Employee> employees = CallDatabase.GetAllEmployees(query);
List<Employee> result = new List<Employee>();
foreach(var employee in employees)
{
if(employee.MatchesFilter(filter))
{
result.Add(employee);
}
}
return result;
}
}
}