Exemple #1
0
        public async System.Threading.Tasks.Task <ActionResult> Information(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var contest = await _db.Contests.FindAsync(id);

            if (contest == null)
            {
                return(HttpNotFound());
            }

            var userAttempts =
                _db.UserAttempts.Where(ua => ua.ContestId == contest.Id)
                .Include(ua => ua.Contest)
                .Include(ua => ua.DevelopmentTool)
                .Include(ua => ua.Task)
                .Include(ua => ua.User)
                .OrderByDescending(dt => dt.CreatedDate);

            var model = new ParticipantInformationViewModel
            {
                Contest      = contest,
                UserAttempts = userAttempts
            };

            return(View(model));
        }
 public static ParticipantInformationDto Map(this ParticipantInformationViewModel dto)
 {
     return(new ParticipantInformationDto()
     {
         Document = dto.Document,
         FileInfo = dto.File,
     });
 }
Exemple #3
0
 public async Task <ActionResult> Process([FromForm] ParticipantInformationViewModel participantInformationViewModel)
 {
     return(await _fileProcessService.Process(participantInformationViewModel.Map()));
 }