Esempio n. 1
0
        public async Task <QueryExecutionResult <EmployeeEntity> > HandleAsync(RemoveEmployeeAddressQuery query)
        {
            var employeeEntity = await _repository.FirstAsync(new EmployeeWithIdSpecification(query.EmployeeId));

            var queryExecutionResult = new QueryExecutionResult <EmployeeEntity>(employeeEntity);

            return(queryExecutionResult);
        }
Esempio n. 2
0
        public async Task <IActionResult> RemoveAddress(RemoveEmployeeAddressQuery query, RemoveEmployeeAddressCommand command)
        {
            await _employeeService.HandleAsync(command);

            await _notificationService.HandleAsync(new CreateNotificationCommand(query.EmployeeId, "The address is removed from the employee address list."));

            var queryExecutionResult = await _employeeService.HandleAsync(query);

            var vm = BuildAddressesVm(queryExecutionResult.Result, new SearchEmployeeAddressQuery());

            return(PartialView(vm));
        }
Esempio n. 3
0
 private string RemoveAddressUri(RemoveEmployeeAddressQuery query) => Url.AppUri(nameof(RemoveAddress), nameof(EmployeeController), query);