コード例 #1
0
        // 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));
            }
        }
コード例 #2
0
 public IEnumerable <Candidate> GetCandidates()
 {
     return(repository.GetCandidates());
 }
コード例 #3
0
 IList <Candidate> ICandidatesQuery.GetCandidates(IEnumerable <Guid> ids)
 {
     return(_repository.GetCandidates(ids));
 }