public Prediction(int id, IPlayer player, IFixture fixture, IPredictionScore score) { Id = id; Player = player; Fixture = fixture; Score = score; }
public void UpdateScore(int id, IPredictionScore score) { try { using (var connection = DatabaseConnection.NewConnection()) { connection.Execute( @"UPDATE Prediction(homeGoals, awayGoals) VALUES (@HomeGoals, @AwayGoals) WHERE PredictionId = @PredictionId", new { HomeGoals = score.HomeGoals, AwayGoals = score.AwayGoals, PredictionId = id } ); } } catch (Exception ex) { //TODO: Log: Logger.Insert(ex.Message, "Prediction", Id, Logger.Category.Error, DateTime.Now, player.User.Id); throw ex; } }
public ClosedPrediction(int id, IPlayer player, IFixture fixture, IPredictionScore predictionScore) : base(id, player, fixture, predictionScore) { }