static MorceauRobotRepo() { morceauRobot = new Dictionary <int, MorceauRobot>(); var robot1 = new MorceauRobot { Id = GetNextId(), Nom = "nom1", Description = "desc1", Longueur = 1.0, }; var robot2 = new MorceauRobot { Id = GetNextId(), Nom = "nom2", Description = "desc2", Longueur = 2.0, }; morceauRobot.Add(robot1.Id, robot1); morceauRobot.Add(robot2.Id, robot2); }
public void Post(MorceauRobot morceauRobot) { morceauRobot.Id = MorceauRobotRepo.GetNextId(); MorceauRobotRepo.MorceauxRobot[morceauRobot.Id] = morceauRobot; }