public void TryAppendSavedGameMoves(TblGame game) { List <TblGame> gameMoves = GetAll(); if (!gameMoves.Contains(game)) { RepositoryProvider.GetRepository <TblGame>().Insert(game); } }
public void AfterGameFinished(IGame game) { TblGame tblGame = new TblGame() { WinnerPlayerNumber = game.Winner?.PlayerNumber }; foreach (var move in game.Moves) { tblGame.TblMove.Add(move); } Providers.ServiceProvider.GetService <GameService>().TryAppendSavedGameMoves(tblGame); }