public string AcceptRequest(int id, string reqU, string accU) { var games = repository.GetByColumName("Id", id); if (games.Count < 1) { return("game not found"); } var game = games.FirstOrDefault(); game.Status = GameStatus.Start; var b = repository.Update(game, id); if (!b) { return("unsucces"); } var a = new PlayGameRepository().Insert(new SrzJson().srz(new UIPlayGame(reqU, accU, id))); return(a > 0?"success": "unsuccess"); }
public GameController( ) { repository = new PlayGameRepository(); }