public Laborer GetByIdNumber(long idNumber) { var laborer = _laborerService.GetLaborerByIdNumber(idNumber.ToString()); if (laborer != null) { return(laborer.ToModel()); } else { throw new Exception(); } }
public IActionResult Get() { var laborer = _laborerService.GetLaborerByIdNumber(CurrentUser.IdNumber); if (laborer != null) { var laborerJson = laborer.ToDto(); return(Json(laborerJson)); } else { return(new NotFoundResult()); } }