public override async Task <GetByDepartmentIdRsponse> GetByDepartmentId(GetByDepartmentIdRequest request, ServerCallContext context) { var result = new GetByDepartmentIdRsponse(); var empyloees = await _empyloyeeRepository.GetByDepartmentId(request.DepartmentId); result.Smployees.AddRange(empyloees); return(result); }
public async Task <IActionResult> GetByGepartmentId(int departmentId) { var employees = await _empyloyeeRepository.GetByDepartmentId(departmentId); if (!employees.Any()) { return(NoContent()); } return(Ok(employees)); }