Esempio n. 1
0
        public IActionResult Get()
        {
            try
            {
                try
                {
                    var results = new ObjectResult(_projectsRepository.GetAll())
                    {
                        StatusCode = (int)HttpStatusCode.OK
                    };
                    Request.HttpContext.Response.Headers.Add("X-Total-Count", _projectsRepository.GetAll().Count().ToString());

                    return(results);
                }
                catch (Exception ex)
                {
                    log.WriteLog(ex.ToString(), "ProjectsController.txt");
                    return(BadRequest());
                }
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.ToString(), "ProjectsController.txt");
                return(BadRequest());
            }
        }
        public IActionResult Index(string nameFilter, int pageNo)
        {
            var pagingInfo = GetPagingInfo(pageNo);
            PagedList <Project> projects = projectsRepo.GetAll(nameFilter, pagingInfo);

            ViewBag.NameFilter = nameFilter;
            return(View(nameof(Index), projects));
        }
Esempio n. 3
0
        public async Task <IEnumerable <Project> > GetAll()
        {
            _logger.LogDebug("Getting all Projects.");
            IEnumerable <Project> projects = await _projectsRepository.GetAll();

            foreach (Project project in projects)
            {
                project.Complete = await _tasksRepository.AllTasksAreCompleted(project.ProjectName);
            }

            return(projects);
        }
Esempio n. 4
0
 public IEnumerable <Customer> GetAll()
 {
     return(_projectsRepository.GetAll());
 }
Esempio n. 5
0
 public List <ProjectDto> GetAll()
 {
     return(_projectsRepository.GetAll());
 }
Esempio n. 6
0
 public IEnumerable <Product> Get()
 {
     return(_projectsRepository.GetAll());
 }