Exemplo n.º 1
0
        public IActionResult Index()
        {
            var model = new ContestViewModel();

            model.Contests = _contestRepository.GetAllContests().OrderByDescending(d => d.Date).ToList();
            return(View(model));
        }
Exemplo n.º 2
0
 public HttpResponseMessage <List <Contest> > GetAllContests(HttpRequestMessage request)
 {
     try
     {
         return(new HttpResponseMessage <List <Contest> >(contestRepository.GetAllContests())
         {
             StatusCode = HttpStatusCode.OK
         });
     }
     catch
     {
         return(new HttpResponseMessage <List <Contest> >(null)
         {
             StatusCode = HttpStatusCode.BadRequest
         });
     }
 }
 public Task <IEnumerable <Contest> > GetContests()
 {
     return(_contestRepository.GetAllContests());
 }