// 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));
            }
        }
Ejemplo n.º 2
0
 public IEnumerable <Candidate> GetCandidates()
 {
     return(repository.GetCandidates());
 }
Ejemplo n.º 3
0
 IList <Candidate> ICandidatesQuery.GetCandidates(IEnumerable <Guid> ids)
 {
     return(_repository.GetCandidates(ids));
 }