Exemple #1
0
        public async Task <ViewData> ValidateResults()
        {
            var response = await _bowlingApi.GetResults();

            var token  = response.Token;
            var scores = response.Points;

            var points = _calculator.CalulatePoints(scores);

            var payload = new ValidationPayload()
            {
                points = points,
                token  = token
            };

            var result = await _bowlingApi.ValidateCalculations(payload);

            return(new ViewData()
            {
                Scores = scores,
                CalculatedPoints = points,
                Result = result.Success
            });
        }
Exemple #2
0
 public async Task <ValidationResponse> ValidateCalculations(ValidationPayload payload)
 {
     return(await _apiService.PostData <ValidationPayload, ValidationResponse>(payload, url));
 }