// GET: api/Candidates public ResponseModel Get() { try { List <CandidateModel> Candidates = _ICandidatesRepository.GetCandidates(); if (Candidates.Count > 0) { ResponseModel SuccessResponse = Helpers.ResponseFactory.Create(true); SuccessResponse.Object = Candidates; return(SuccessResponse); } ResponseModel ErrorResponse = Helpers.ResponseFactory.Create(false); ErrorResponse.Message = "No se encontraron resultados."; return(ErrorResponse); } catch (Exception ex) { Helpers.Utils.RegisterException("Candidates: Get", ex.Message); return(Helpers.ResponseFactory.Create(false)); } }
public IEnumerable <Candidate> GetCandidates() { return(repository.GetCandidates()); }
IList <Candidate> ICandidatesQuery.GetCandidates(IEnumerable <Guid> ids) { return(_repository.GetCandidates(ids)); }