public TimingSession ResumeSession(Id <RecordingSessionDto> recordingSessionId) { using var s = sync.UseOnce(); var recordingSessionDto = ActiveRecordingSession = eventRepository.GetRawDtoById(recordingSessionId); return(ActiveTimingSession = CreateTimingSession(recordingSessionDto)); }
public TimingSession StartSession(Id <SessionDto> sessionDtoId, string name) { var recordingSessionDto = ActiveRecordingSession = new RecordingSessionDto { Name = name, SessionId = sessionDtoId }; eventRepository.Save(recordingSessionDto); return(ActiveTimingSession = CreateTimingSession(recordingSessionDto)); }
private TimingSession CreateTimingSession(RecordingSessionDto recordingSessionDto) { var staticData = LoadTimingSessionStaticData(recordingSessionDto.SessionId); var timingSession = ActiveTimingSession = autoMapperProvider.Map <TimingSession>(recordingSessionDto); timingSession.StartTime = recordingSessionDto.Created; timingSession.MinLap = staticData.MinLap; timingSession.FinishCriteria = staticData.FinishCriteria; timingSession.Initialize(autoMapperProvider.Map <List <Checkpoint> >(eventRepository.GetRawDtos <CheckpointDto>(x => x.RecordingSessionId == recordingSessionDto.Id))); return(timingSession); }