public async Task<PredictionResult> SavePredictionAsync(SavePredictionModel savePredictionModel) { var parameters = new Dictionary<string, string> { { "gameId", savePredictionModel.GameId.ToString() }, { "weekId", savePredictionModel.WeekId }, { "awayTeamScore", savePredictionModel.AwayPrediction.ToString() }, { "homeTeamScore", savePredictionModel.HomePrediction.ToString() } }; if (savePredictionModel.PredictionId > 0) { parameters.Add("id", savePredictionModel.PredictionId.ToString()); var result = (await Client.UpdateTable("predictions", parameters)).AsDictionary(); return result[0].AsPredictionResult(); } else { var result = (await Client.InsertIntoTable("predictions", parameters)).AsDictionary(); return result[0].AsPredictionResult(); } }
public async Task<PredictionResult> SavePredictionAsync(SavePredictionModel savePredictionModel) { return new PredictionResult(); }