예제 #1
0
        public Task <string> GetAsync(string challengeId, string taskId, string teamId)
        {
            string result = null;

            try
            {
                result = new ChallengeRepository().GetSolutions().Result
                         .First(kvp => kvp.Key.EndsWith("\\" + challengeId + "\\" + taskId + "\\" + teamId)).Value;
            }
            catch (Exception ex)
            {
                var ioex = (IOException)ex;
            }
            return(Task.FromResult(result));
        }
예제 #2
0
        public Task <string[]> AllAsync()
        {
            var allTeams = new List <string>();
            var folders  = ChallengeRepository.GetFolders();

            foreach (var folder in folders)
            {
                var exists = allTeams.FirstOrDefault(t => t == Path.GetFileName(folder));
                if (exists == null)
                {
                    allTeams.Add(Path.GetFileName(folder));
                }
            }
            return(Task.FromResult(allTeams.ToArray()));
        }
        public static List <string> GetFolders()
        {
            var result = new List <string>();
            var challengeRepository = new ChallengeRepository();
            var challenges          = challengeRepository.GetAll();

            foreach (var challenge in challenges)
            {
                var taskRepository = new TaskRepository(challenge);
                var tasks          = taskRepository.GetAll();
                foreach (var task in tasks)
                {
                    var teamRepository = new TeamRepository(task);
                    var teams          = teamRepository.GetAll();
                    result.AddRange(teams);
                }
            }
            return(result);
        }