예제 #1
0
        public List <Bug> GetAllBugs()
        {
            BugRepository repo    = new BugRepository();
            List <Bug>    bugList = repo.GetAll().ToList();

            return(bugList);
        }
예제 #2
0
        public IActionResult Get()
        {
            var bugs     = _bugRepository.GetAll();
            var bugsDtos = _mapper.Map <List <BugResponseDto> >(bugs);

            return(Ok(bugsDtos));
        }
예제 #3
0
        public List <Bug> GetBugsByProject(Project project)
        {
            BugRepository bugRepo = new BugRepository();

            List <Bug> bugList = bugRepo.GetAll().Where(x => x.Project.Id == project.Id).ToList();

            return(bugList);
        }
예제 #4
0
 public IHttpActionResult Get()
 {
     using (var context = new DataContext()) {
         BugRepository bugRepository = new BugRepository(context);
         var           bugs          = bugRepository.GetAll();
         var           models        = MapperHelper.Map <ICollection <BugApi> >(bugs);
         return(Ok(models));
     }
 }
예제 #5
0
        public Controller()
        {
            if (_isLoaded)
            {
                return;
            }

            UserRepository.Load(Persistence.Controller.GetUsers());
            BugRepository.Load(Persistence.Controller.GetBugs());
            TaskRepository.Load(Persistence.Controller.GetTasks());


            foreach (var bug in BugRepository.GetAll())
            {
                bug.Load(TaskRepository.GetAll().Where(x => x.Bug.Id == bug.Id).ToList());
            }
            foreach (var employee in UserRepository.GetAll().OfType <Employee>())
            {
                employee.Load(TaskRepository.GetAll().Where(x => x.Employee != null && x.Employee.Id == employee.Id).ToList());
            }

            _isLoaded = true;
        }
예제 #6
0
 public List <Bug> GetAll()
 {
     return(_bugRepository.GetAll());
 }