Пример #1
0
 public void CreatePlayer(string name, bool activPlayer, Guid signalRId)
 {
     Player newPlayer = new Player
     {
         Name = name,
         ActivPlayer = activPlayer,
         SignalRId = signalRId
     };
     SavePlayer(newPlayer);
 }
Пример #2
0
 private void SavePlayer(Player newPlayer)
 {
     if (newPlayer.Id == 0)
         context.Players.Add(newPlayer);
     else
         context.Entry(newPlayer).State = EntityState.Modified;
     context.SaveChanges();
 }