public async Task <List <NotaModel> > Handle(NotaQuery message, CancellationToken token) { return(await _context.Notes .Where(n => n.IdObserver == message.IdObservator && n.IdPollingStation == message.IdSectieDeVotare) .OrderBy(n => n.LastModified) .Select(n => new NotaModel { IdNota = n.Id, CaleFisierAtasat = n.AttachementPath, TextNota = n.Text, CodFormular = n.Question.FormCode, CodIntrebare = n.Question.Id }) .ToListAsync()); }
public async Task <List <NotaModel> > Handle(NotaQuery message) { return(await _context.Nota .Where(n => n.IdObservator == message.IdObservator && n.IdSectieDeVotare == message.IdSectieDeVotare) .OrderBy(n => n.DataUltimeiModificari) .Select(n => new NotaModel { IdNota = n.IdNota, CaleFisierAtasat = n.CaleFisierAtasat, TextNota = n.TextNota, CodFormular = n.IdIntrebareNavigation.CodFormular, CodIntrebare = n.IdIntrebareNavigation.IdIntrebare }) .ToListAsync()); }