public async Task <IActionResult> RemoveEmail(RemoveEmployeeEmailQuery query, RemoveEmployeeEmailCommand command) { await _employeeService.HandleAsync(command); var queryExecutionResult = await _employeeService.HandleAsync(query); var vm = BuildEmailsVm(queryExecutionResult.Result); return(PartialView(vm)); }
public async Task <CommandExecutionResult> HandleAsync(RemoveEmployeeEmailCommand command) { await _repository.RemoveAsync(new EmailForIdSpecification(command.EmailId)); return(CommandExecutionResult.Success); }