public async Task <RequestProblemSubmission> RequestSolutionSubmission(SolutionSubmission submission, CancellationToken token) { if (submission == null) { throw new WebArgumentException(nameof(submission), nameof(RequestProblemSubmission), null); } var guid = Guid.NewGuid().ToString(); var path = Path.Combine(Configuration.FileLocation, guid); if (!await ProblemService.Exists(submission.ProblemId, token)) { return new RequestProblemSubmission { Result = SolutionServiceResult.StartOver } } ; var solution = new Solution { Id = guid, ProblemId = submission.ProblemId, TimeStamp = (long)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds, FileLocation = path, User = User.Identity.Name, SolutionType = submission.SolutionType }; var result = await SolutionService.AddSolutionSet(guid, solution, token); var requestResult = new RequestProblemSubmission { Result = result }; if (result == SolutionServiceResult.Success) { requestResult.Guid = guid; } return(requestResult); }