-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOneLoopSystem.cs
More file actions
25 lines (24 loc) · 782 Bytes
/
OneLoopSystem.cs
File metadata and controls
25 lines (24 loc) · 782 Bytes
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
using System;
using System.Collections.Generic;
using AutoMapper;
namespace ListProcessing
{
class OneLoopSystem : IHRSystem
{
public (long, JobCandidate, IList<Employee>) ProcessApplications(IEnumerable<JobCandidate> candidates, IMapper mapper)
{
long sum = 0;
var employeeList = new SortedList<int, Employee>();
JobCandidate lastItem = null;
foreach (var item in candidates)
{
sum += item.Value;
var newItem = mapper.Map<Employee>(item);
newItem.ComputeFibonacci();
employeeList.Add(item.Index, newItem);
lastItem = item;
};
return (sum, lastItem, employeeList.Values);
}
}
}