public void AddParking(Parking parking, int departmentId, int universityId) { document.Root.Element("Parkings").Add(new XElement("Parking", new XAttribute("Name", parking.Name) , new XAttribute("DepartmentId", departmentId) , new XAttribute("UniversityId", universityId))); foreach (Car car in parking.Cars) { AddCar(car, departmentId); } foreach (Garage garage in parking.Garages) { AddGarage(garage, departmentId); } AddHead(parking.Head, departmentId); AddAddress(parking.Address, departmentId); document.Save(fileName); }
/// <summary> /// Method that add parking to the list of parkings. /// </summary> /// <param name="parking">Parking that need to add.</param> public void AddParking(Parking parking) { Parkings.Add(parking); }