public async Task <IActionResult> Phones(SearchEmployeePhoneQuery query) { var queryExecutionResult = await _employeeService.HandleAsync(query); var vm = BuildPhonesVm(queryExecutionResult.Result); return(View(vm)); }
public async Task <QueryExecutionResult <EmployeeEntity> > HandleAsync(SearchEmployeePhoneQuery query) { var employeeEntity = await _repository.FirstAsync(new EmployeeWithIdSpecification(query.EmployeeId)); var queryExecutionResult = new QueryExecutionResult <EmployeeEntity>(employeeEntity); return(queryExecutionResult); }
private string PhonesUri(SearchEmployeePhoneQuery query) => Url.AppUri(nameof(Phones), nameof(EmployeeController), query);