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());
     }
 }
Beispiel #3
0
 public IEnumerable <Game> GetAll()
 {
     using (var context = new TicTacToeModels())
     {
         return(context.Games.ToList());
     }
 }
Beispiel #4
0
 public Game Find(int id)
 {
     using (var context = new TicTacToeModels())
     {
         return(context.Games.Find(id));
     }
 }
Beispiel #5
0
 public void Add(Game entity)
 {
     using (var context = new TicTacToeModels())
     {
         context.Games.Add(entity);
         context.SaveChanges();
     }
 }
Beispiel #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();
     }
 }