示例#1
0
        public IEnumerable <Jobs> GetAll()
        {
            var result = _jobsRepository
                         .GetAll()
                         .OrderByDescending(x => x.CreatedAt);

            return(result);
        }
        /// <summary>
        /// Populates all jobs
        /// </summary>
        /// <returns>List of jobs</returns>
        public List <Job> GetAll()
        {
            var        eties = _repository.GetAll();
            List <Job> jobs  = new List <Job>();

            if (eties != null && eties.Any())
            {
                foreach (var ety in eties)
                {
                    jobs.Add(this.Mapper.CreateJobModel(ety));
                }
            }
            return(jobs);
        }
        public IActionResult Get()
        {
            IEnumerable <PrinterJob> result = null;

            try
            {
                result = _repository.GetAll();
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Ok(result));
        }