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());
     }
 }
예제 #3
0
 public IEnumerable <Game> GetAll()
 {
     using (var context = new TicTacToeModels())
     {
         return(context.Games.ToList());
     }
 }
예제 #4
0
 public Game Find(int id)
 {
     using (var context = new TicTacToeModels())
     {
         return(context.Games.Find(id));
     }
 }
예제 #5
0
 public void Add(Game entity)
 {
     using (var context = new TicTacToeModels())
     {
         context.Games.Add(entity);
         context.SaveChanges();
     }
 }
예제 #6
0
 public void Update(Game entity)
 {
     using (var context = new TicTacToeModels())
     {
         var oldEntity = Find(entity.Id);
         context.Entry(oldEntity).CurrentValues.SetValues(entity);
         context.SaveChanges();
     }
 }