Ejemplo n.º 1
0
 public static ParkingPlace Create(ParkingSegment segment)
 {
     return new ParkingPlace
     {
         Id = Guid.NewGuid(),
         Segment = segment,
         SegmentId = segment.Id,
         Parking = segment.Parking,
         ParkingId = segment.ParkingId,
         Status = Status.Free,
         Number = segment.Places.Count
     };
 }
Ejemplo n.º 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;
 }