public TarefaFormDto CarregarForm(long id)
 {
     return(_tarefaRepository.GetAll()
            .Where(w => w.Id == id)
            .Select(t => new TarefaFormDto
     {
         Id = t.Id,
         Titulo = t.Titulo,
         Descricao = t.Descricao,
     })
            .FirstOrDefault());
 }
Example #2
0
        public Task <List <TarefaViewModel> > Handle(GetTarefaQuery request,
                                                     CancellationToken cancellationToken)
        {
            var tarefas = _repository.GetAll();

            var viewModel = tarefas.Where(_ => _.Ativo == true)
                            .Select(_ => new TarefaViewModel
            {
                Id        = _.Id,
                Titulo    = _.Titulo,
                Descricao = _.Descricao
            })
                            .OrderByDescending(_ => _.Id)
                            .ToList();

            return(Task.FromResult(viewModel));
        }
Example #3
0
 public IEnumerable <TarefaViewModel> GetAll()
 {
     return(_tarefaRepository.GetAll().ProjectTo <TarefaViewModel>(_mapper.ConfigurationProvider));
 }
Example #4
0
 public IEnumerable <Tarefa> GetAll()
 {
     return(_tarefaRepository.GetAll());
 }