예제 #1
0
 public static Parking Create(string name, Guid newId)
 {
     var parking = new Parking
     {
         Name = name,
         Id = newId
     };
     parking.Update();
     return parking;
 }
예제 #2
0
 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;
 }