public async Task <SkillResponse> HandleSkillRequest(SkillRequest skillRequest, ILambdaContext lambdaContext) { if (lambdaContext == null) { throw new ArgumentNullException("lambdaContext"); } this.logger.LogTrace("BEGIN Handling request type '{0}'. RequestId: {1}.", skillRequest.Request.Type, skillRequest.Request.RequestId); // Determine the correct handler IRequestRouter requestHandler = this.requestMapper.GetRequestHandler(skillRequest); // Handle the request SkillResponse response = response = await requestHandler.GetSkillResponse(skillRequest); this.logger.LogTrace("END Handling request type '{0}'. RequestId: {1}. Response: {2}", skillRequest.Request.Type, skillRequest.Request.RequestId, JsonConvert.SerializeObject(response)); return(response); }
public async Task <SkillResponse> GetSkillResponse(SkillRequest skillRequest, TokenUser tokenUser) { if (!this.skillRequestValidator.IsValid(skillRequest)) { throw new ArgumentNullException("skillRequest"); } if (tokenUser == null) { throw new ArgumentNullException("tokenUser"); } this.logger.LogTrace("BEGIN GetSkillResponse. RequestId: {0}.", skillRequest.Request.RequestId); IRequestRouter requestHandler = this.requestMapper.GetRequestHandler(skillRequest); SkillResponse response = response = await requestHandler.GetSkillResponse(skillRequest, tokenUser); this.logger.LogTrace("END GetSkillResponse. RequestId: {0}.", skillRequest.Request.RequestId); return(response); }