public void Save(string acronym) { int i = 0; ObjectParameter tableIdParam = new ObjectParameter("TabId", typeof(int)); int tableId; using (ProjetSGBDEntities context = new ProjetSGBDEntities()) { foreach (Table table in Tables) { i++; context.NewTable(_recId, i, acronym, tableIdParam); tableId = Int32.Parse(tableIdParam.Value.ToString()); foreach (GetReservation_Result seated in table.Seateds) { context.NewSit(tableId, seated.ClientId, acronym); } } } }