Ejemplo n.º 1
0
 public void CreateGame(int status, int result, string name1, string name2, Guid guidId1, Guid guidId2)
 {
     Game newGame = new Game
     {
         Status = status,
         Result = result,
         Name1 = name1,
         Name2 = name2,
         GuidId1 = guidId1,
         GuidId2 = guidId2
     };
     SaveGame(newGame);
 }
Ejemplo n.º 2
0
 private void SaveGame(Game newGame)
 {
     if (newGame.Id == 0)
         context.Games.Add(newGame);
     else
         context.Entry(newGame).State = EntityState.Modified;
     context.SaveChanges();
 }