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());
 }
예제 #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));
        }
예제 #3
0
 public IEnumerable <TarefaViewModel> GetAll()
 {
     return(_tarefaRepository.GetAll().ProjectTo <TarefaViewModel>(_mapper.ConfigurationProvider));
 }
예제 #4
0
 public IEnumerable <Tarefa> GetAll()
 {
     return(_tarefaRepository.GetAll());
 }