Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
fix(back-end): Correct the problem that is generated when calling the…
Browse files Browse the repository at this point in the history
… method 'EmployeesWithContractCloseToExpiration'
  • Loading branch information
CarlosPavajeau committed Jan 27, 2021
1 parent 248b668 commit deeda13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Infrastructure/Repositories/EmployeesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ private async Task<IEnumerable<string>> GetOccupiedEmployeesCodes(DateTime date)
public async Task<IEnumerable<Employee>> EmployeesWithContractCloseToExpiration()
{
DateTime today = DateTime.Now;
return await GetAll().Include(e => e.EmployeeContract).Include(e => e.User)
.Where(e => (e.EmployeeContract.EndDate - today).Days == 3)
return await GetAll().Include(e => e.EmployeeContract)
.Include(e => e.User)
.Where(e => MySqlDbFunctionsExtensions.DateDiffDay(EF.Functions, e.EmployeeContract.EndDate, today) == 3)
.ToListAsync();
}

Expand Down

0 comments on commit deeda13

Please sign in to comment.