Skip to content

Commit

Permalink
R: Convert to instance method
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgu committed Mar 19, 2016
1 parent 3a769df commit 252fa93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions EmployeeCollection.cs
Expand Up @@ -16,12 +16,11 @@ public List<Employee> Items
get { return _employeeCollection; }
}

public static void AddEmployeeIfMatch(EmployeeFilter employeeFilter, string name, int age, bool isSalaried,
EmployeeCollection employeeCollection, int id)
public void AddEmployeeIfMatch(EmployeeFilter employeeFilter, string name, int age, bool isSalaried, int id)
{
if (employeeFilter.Matches(name, age, isSalaried))
{
employeeCollection.Items.Add(new Employee
Items.Add(new Employee
{
Name = name,
Id = id,
Expand Down
2 changes: 1 addition & 1 deletion Yucky.cs
Expand Up @@ -40,7 +40,7 @@ public static EmployeeCollection GetEmployees(EmployeeFilter employeeFilter, Fak
int age = reader.GetInt32(EmployeeAgeColumnIndex);
bool isSalaried = reader.GetBoolean(EmployeeIsSalariedColumnIndex);

EmployeeCollection.AddEmployeeIfMatch(employeeFilter, name, age, isSalaried, employeeCollection, id);
employeeCollection.AddEmployeeIfMatch(employeeFilter, name, age, isSalaried, id);
}
}

Expand Down

0 comments on commit 252fa93

Please sign in to comment.