private static SMRequest ConstructSMRequest(Challenge challenge) { SMRequest retVal = new SMRequest(); retVal.challenge = challenge; return retVal; }
public static async Task<Challenge> postChallengeQuestion(User user, Challenge challenge, int offerId) { string route = !String.IsNullOrEmpty(user.id) ? APIRoutes.challengeAnswerSubmissionWithUserIdRoute(user.id, challenge.skillsTestQuestion.id, offerId) : APIRoutes.challengeAnswerSubmissionWithExternalIdRoute(user.external_id, challenge.skillsTestQuestion.id, offerId); SMResponse m = await AsyncClient.post(route, ConstructSMRequest(challenge)); return m == null ? null : m.challenge; }