public ParkingSession StartParkingSession(Entrance entrance, Vehicle vehicle, Valet valet, ParkingPlace parkingPlace) { var parkingSession = ParkingSession.Start(_identityProvider, entrance, vehicle, valet, parkingPlace); var storageParkingSession = _mappingEngine.Map<Storage.ParkingSession>(parkingSession); _parkingSessionRepository.Add(storageParkingSession); _parkingSessionRepository.Save(); return parkingSession; }
private ParkingSession(long id, Entrance entrance, Vehicle vehicle, Valet valet, ParkingPlace parkingPlace, ParkingPeriod parkingPeriod) { _id = id; Entrance = entrance; Vehicle = vehicle; Valet = valet; ParkingPlace = parkingPlace; ParkingPeriod = parkingPeriod; }
internal static ParkingSession Restore( long id, Entrance entrance, Vehicle vehicle, Valet valet, ParkingPlace parkingPlace, DateTime startTime, DateTime? endTime) { return new ParkingSession(id, entrance, vehicle, valet, parkingPlace, new ParkingPeriod(startTime, endTime)); }
public static ParkingSession Start(IIdentityProvider identityProvider, Entrance entrance, Vehicle vehicle, Valet valet, ParkingPlace parkingPlace) { var id = identityProvider.GetId(); return new ParkingSession(id, entrance, vehicle, valet, parkingPlace, new ParkingPeriod(DateTime.Now, null)); }