// Intelligent mappings..may be better somewhere else? public static void WriteTotalRuntime(RecordingDto dto, RecordingDataSet.Recording recording) { int runTime = 0; foreach (RecordingDataSet.Track track in recording.GetTracks()) { runTime += track.Duration; } dto.totalRunTimeSpecified = true; dto.totalRunTime = runTime; }
static void WriteTracks(RecordingDto recordingDto, RecordingDataSet.Recording recording) { recordingDto.tracks = new TrackDto[recording.GetTracks().Length]; int index = 0; foreach (RecordingDataSet.Track track in recording.GetTracks()) { //recordingDto.tracks[index++] = new TrackDto(); recordingDto.tracks[index++] = WriteTrack(track); } }