Exemplo n.º 1
0
        /// <summary>
        /// Handles the GetEmployeeByMatricule command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <returns></returns>
        public async Task <IEmployeeDao> HandleAsync(GetEmployeeByMatriculeCommand command)
        {
            var employeeDto = EmployeeDto.InitEmployeeMatricule(command.Matricule);
            var employee    = await _employeeDal.GetEmployeeByMatriculeAsync(employeeDto);

            return(employee);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the DeleteEmployee command
        /// </summary>
        /// <param name="command">The command</param>
        /// <returns></returns>
        public async Task HandleAsync(DeleteEmployeeCommand command)
        {
            var employeeDto = EmployeeDto.InitEmployeeMatricule(command.Matricule);

            await _employeeDal.DeleteEmployeeAsync(employeeDto);
        }