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

Commit

Permalink
refactor(back-end): Drop 'Where' and move the condition into the 'Fir…
Browse files Browse the repository at this point in the history
…stOrDefault'
  • Loading branch information
CarlosPavajeau committed Dec 25, 2020
1 parent 1c771d2 commit d3c2b40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Kaizen/Controllers/EmployeesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public async Task<ActionResult<EmployeeViewModel>> PutEmployee(string id, Employ
public async Task<ActionResult<EmployeeViewModel>> PostEmployee(EmployeeInputModel employeeModel)
{
EmployeeCharge employeeCharge = await _employeesRepository.GetAllEmployeeCharges()
.Where(c => c.Id == employeeModel.ChargeId)
.FirstOrDefaultAsync();
.FirstOrDefaultAsync(c => c.Id == employeeModel.ChargeId);
if (employeeCharge is null)
{
return BadRequest("El cargo del empleado no se encuentra registrado.");
Expand Down

0 comments on commit d3c2b40

Please sign in to comment.