Example #1
0
        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);
        }
Example #2
0
        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));
        }
Example #3
0
 private string RemovePhoneUri(RemoveEmployeePhoneQuery query) => Url.AppUri(nameof(RemovePhone), nameof(EmployeeController), query);