Exemple #1
0
        public IHttpActionResult ContestList(int from, int to)
        {
            // returns a list of most recent contests

            var all_contests = contest_repository.GetRecentContestsList(from, to);

            return(Ok(ContestListItem.MapTo(all_contests)));
        }
Exemple #2
0
        public IHttpActionResult ContestList()
        {
            // returns a list of all contests

            var all_contests = contest_repository.GetAllContestsList();

            return(Ok(ContestListItem.MapTo(all_contests)));
        }
        public ContestListCollection GetPastContests(int start, int limit)
        {
            // select contests that have ended
            var contests = context.Contests.OrderByDescending(x => x.StartDate).Where(x => x.EndDate < DateTime.Now);

            return(new ContestListCollection()
            {
                TotalCount = contests.Count(),
                Collection = ContestListItem.MapTo(contests.Skip(start - 1).Take(limit - start + 1)),
            });
        }
 public IHttpActionResult GetContestHistory(int id)
 {
     return(Ok(ContestListItem.MapTo(user_repository.GetUserContestHistory(id))));
 }