public void AddEmployee(Employee employee) { employeeRepository.AddEmployee(employee); List <Vacation> vacations = vacationRepository.GetAllVacations(); //get vacation list of all our vacation foreach (Vacation vacation in vacations) //loop in each one of them and add employee to each vacation with its default value { EmployeeBalance employeeBalance = new EmployeeBalance(); employeeBalance.Employee = employee; employeeBalance.Vacation = vacation; employeeBalance.Balance = vacation.Balance; employeeBalanceRepository.AddEmployeeBalance(employeeBalance); } }
public async Task <IEnumerable <Model.Vacation> > Get() { return(await _vacationRepository.GetAllVacations()); }
public List <Vacation> GetAllVacations() { return(_vacationRepo.GetAllVacations()); }