Esempio n. 1
0
 public List <ElectionViewModel> GetActiveElections()
 {
     return(_electionRepository.GetAll()
            .Where(x => x.End > DateTime.Now)
            .Select(x => _mapper.Map <ElectionViewModel>(x))
            .ToList());
 }
        public IEnumerable <ElectionViewModel> GetAll(int?electionTypeId)
        {
            var elections = _electionRepository.GetAll(electionTypeId).Result;

            return(elections.Select(ModelTransformer.ElectionToElectionViewModel));
        }
Esempio n. 3
0
 public async Task <IQueryable <Election> > GetElectionsAsync()
 {
     return(await Task.FromResult(_electionRepository.GetAll()));
 }