public bool Criar(CriarTarefaRequest tarefa)
 {
     try
     {
         _criarTarefaRequestValidator.ValidateAndThrow(tarefa);
         _tarefaRepository.Criar(_tarefaAdapter.ConverteCriarTarefaRequestParaTarefa(tarefa));
         return(true);
     }
     catch (ValidationException exv)
     {
         throw new ValidationException(exv.Errors);
     }
 }
Beispiel #2
0
        public TarefaViewModel Criar(TarefaViewModel tarefaViewModel)
        {
            var tarefa = Mapper.Map <Tarefa>(tarefaViewModel);

            return(Mapper.Map <TarefaViewModel>(_tarefaRepository.Criar(tarefa)));
        }