コード例 #1
0
        public async Task <AgendarServicoResult> Execute(AgendarServicoParameter parameter)
        {
            if (parameter.AgendaServico.DataRealizacao < DateTime.Now)
            {
                throw new Exception("Data de agendamento deve ser superior à data atual");
            }

            var agendaServico = _mapper.Map <AgendaServico>(parameter.AgendaServico);

            await _servicoRepository.AgendarServico(agendaServico);

            return(new AgendarServicoResult());
        }