public async Task <IActionResult> GeneralInfo(UpdateEmployeeGeneralInfoQuery query) { var employeeEntity = await _employeeService.HandleAsync(query); var vm = BuildGeneralInfoForm(employeeEntity.Result); return(View("FormView", vm)); }
public async Task <QueryExecutionResult <EmployeeEntity> > HandleAsync(UpdateEmployeeGeneralInfoQuery query) { var employeeEntity = await _repository.FirstAsync(new EmployeeWithIdSpecification(query.EmployeeId)); var queryExecutionResult = new QueryExecutionResult <EmployeeEntity>(employeeEntity); return(queryExecutionResult); }
public async Task <IActionResult> GeneralInfo(UpdateEmployeeGeneralInfoQuery query, UpdateEmployeeGeneralInfoCommand command) { if (ModelState.IsValid == false) { var employeeEntity = command.Adapt <EmployeeEntity>(); var vm = BuildGeneralInfoForm(employeeEntity); return(PartialView(vm)); } await _employeeService.HandleAsync(command); return(RedirectToAction(nameof(Index), new SearchEmployeeQuery(command.EmployeeNo))); }
private string GeneralInfoUri(UpdateEmployeeGeneralInfoQuery query) => Url.AppUri(nameof(GeneralInfo), nameof(EmployeeController), query);