public static Parking Create(string name, Guid newId) { var parking = new Parking { Name = name, Id = newId }; parking.Update(); return parking; }
public static ParkingSegment Create(Parking parking, string name, int amountPlaces, Guid newId) { var segment = new ParkingSegment { ParkingId = parking.Id, Parking = parking, Name = name, Id = newId }; for (var i = 0; i < amountPlaces; i++) { segment.Places.Add(ParkingPlace.Create(segment)); } return segment; }