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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 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));
 }
コード例 #4
0
 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));
 }