Пример #1
0
        public IHttpActionResult GetProblemList(int start, int limit)
        {
            var problems = problem_repository.GetProblems(start, limit);


            return(Ok(new CollectionResponse()
            {
                TotalCount = problem_repository.GetProblemCount(),
                Collection = ProblemListItem.MapTo(problems)
            }));
        }
Пример #2
0
 public void OnGet()
 {
     Exclude = Request.Query["exclude"];
     if (string.IsNullOrEmpty(Exclude))
     {
         Problems = _repository.GetProblems();
     }
     else
     {
         Problems             = _repository.GetExclude(Enum.Parse <ProblemStatus>(Exclude));
         SumOfExcludeProblems = Problems.Count;
     }
     PageIndex     = Convert.ToInt32(Request.Query["pageIndex"]);
     Problems      = _repository.GetPaged(Problems, PageIndex, Const.PageSize);
     SumOfProblems = _repository.GetSum();
 }
Пример #3
0
 public Problem GetProblemByProblemId(string ProblemId, Category category)
 {
     return(ProblemRepository.GetProblems().FirstOrDefault(p => p.ProblemId.Equals(ProblemId) && p.Category.Equals(category)));
 }
Пример #4
0
 public List <Problem> GetProblemList(Category Category)
 {
     return(ProblemRepository.GetProblems(Category));
 }
Пример #5
0
 public List <Problem> GetProblemList()
 {
     return(ProblemRepository.GetProblems());
 }