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