public async Task <QueryExecutionResult <EmployeeEntity> > HandleAsync(RemoveEmployeePhoneQuery query) { var employeeEntity = await _repository.FirstAsync(new EmployeeWithIdSpecification(query.EmployeeId)); var queryExecutionResult = new QueryExecutionResult <EmployeeEntity>(employeeEntity); return(queryExecutionResult); }
public async Task <IActionResult> RemovePhone(RemoveEmployeePhoneQuery query, RemoveEmployeePhoneCommand command) { await _employeeService.HandleAsync(command); var queryExecutionResult = await _employeeService.HandleAsync(query); var vm = BuildPhonesVm(queryExecutionResult.Result); return(PartialView(vm)); }
private string RemovePhoneUri(RemoveEmployeePhoneQuery query) => Url.AppUri(nameof(RemovePhone), nameof(EmployeeController), query);