public Player Find(int id) { using (var context = new TicTacToeModels()) { return(context.Players.Find(id)); } }
public IEnumerable <Player> GetAll() { using (var context = new TicTacToeModels()) { return(context.Players.ToList()); } }
public IEnumerable <Game> GetAll() { using (var context = new TicTacToeModels()) { return(context.Games.ToList()); } }
public Game Find(int id) { using (var context = new TicTacToeModels()) { return(context.Games.Find(id)); } }
public void Add(Game entity) { using (var context = new TicTacToeModels()) { context.Games.Add(entity); context.SaveChanges(); } }
public void Update(Game entity) { using (var context = new TicTacToeModels()) { var oldEntity = Find(entity.Id); context.Entry(oldEntity).CurrentValues.SetValues(entity); context.SaveChanges(); } }