public IHttpActionResult GetProblemList() { if (!user_service.IsAuthorizedToViewAllProblemList()) { return(Unauthorized()); } var problems = problem_repository.GetAllProblemsList(); return(Ok(ProblemListItem.MapTo(problems))); }
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) })); }
public IHttpActionResult GetUserProblems(int id, int start, int limit) { if (!user_service.IsAuthorizedToViewUserProblems(id)) { return(Unauthorized()); } var problems = user_repository.GetProblems(id, start, limit); return(Ok(new CollectionResponse() { TotalCount = user_repository.GetProblemCount(id), Collection = ProblemListItem.MapTo(problems) })); }