Example #1
0
 public void InsertOrUpdate(Match match)
 {
     if (match.Id == default(int))
     {
         // New entity
         context.Matches.Add(match);
     }
     else
     {
         // Existing entity
         context.Matches.Attach(match);
         context.Entry(match).State = EntityState.Modified;
     }
 }
Example #2
0
 public void InsertOrUpdate(Standing standing)
 {
     if (standing.Id == default(int))
     {
         // New entity
         context.Standings.Add(standing);
     }
     else
     {
         // Existing entity
         context.Standings.Attach(standing);
         context.Entry(standing).State = EntityState.Modified;
     }
 }
Example #3
0
 public void InsertOrUpdate(Player player)
 {
     if (player.Id == default(int))
     {
         // New entity
         context.Players.Add(player);
     }
     else
     {
         // Existing entity
         context.Players.Attach(player);
         context.Entry(player).State = EntityState.Modified;
     }
 }