public void CreateStep(int idGame, int xStep, int yStep, int player) { Step newStep = new Step { IdGame = idGame, Player = player, XStep = xStep, YStep = yStep }; SaveStep(newStep); }
private void SaveStep(Step newStep) { if (newStep.Id == 0) context.Steps.Add(newStep); else context.Entry(newStep).State = EntityState.Modified; context.SaveChanges(); }