Exemplo n.º 1
0
        public static int InsertEmployee(Employee employee)
        {
            var command = new InsertEmployeeCommand(employee);

            handleCommand(command);
            return(InsertEmployeeCommand.InsertedID);
        }
        public async Task <IActionResult> InsertEmp(InsertEmployeeCommand command)
        {
            try
            {
                _logger.LogInformation("succes calling api InsertEmp");
                return(Ok(await Mediator.Send(command)));
            }
            catch (Exception e)
            {
                return(BadRequest());

                _logger.LogError(e.Message);
            }
        }