public static List <TrackInfoView> CreateFromTrackInfos(List <TrackInfo> trackInfos) { var trackInfoViews = new List <TrackInfoView>(); trackInfos.ForEach(trackInfo => trackInfo.SegmentTrackInfos.ForEach(segmentTrackInfo => { var trackInfoView = new TrackInfoView() { FileId = trackInfo.FileId, FileName = trackInfo.FileName, FileType = trackInfo.FileType, Language = trackInfo.Language, FileProductivityScore = trackInfo.ProductivityScore, SegmentId = segmentTrackInfo.SegmentId, NumberOfKeys = segmentTrackInfo.NumberOfKeys, Text = segmentTrackInfo.Text, Translated = segmentTrackInfo.Translated, SegmentProductivityScore = segmentTrackInfo.ProductivityScore, UtcDateTime = segmentTrackInfo.UtcDateTime }; trackInfoViews.Add(trackInfoView); })); return(trackInfoViews); }
public static List<TrackInfoView> CreateFromTrackInfos(List<TrackInfo> trackInfos) { var trackInfoViews = new List<TrackInfoView>(); trackInfos.ForEach(trackInfo => { var trackInfoView = new TrackInfoView() { FileId = trackInfo.FileId, FileName = trackInfo.FileName, ProjectName = trackInfo.ProjectName, ProjectId = trackInfo.ProjectId, FileType = trackInfo.FileType, Language = trackInfo.Language, Efficiency = trackInfo.ProductivityScore, KeystrokesSaved = trackInfo.SegmentTrackInfos.Sum(x => x.InsertedCharacters - x.NumberOfKeys < 0 ? 0 : x.InsertedCharacters - x.NumberOfKeys), InsertedCharacters = trackInfo.SegmentTrackInfos.Sum(x => x.InsertedCharacters), }; trackInfoViews.Add(trackInfoView); }); return trackInfoViews; }
public static List<TrackInfoView> CreateFromTrackInfos(List<TrackInfo> trackInfos) { var trackInfoViews = new List<TrackInfoView>(); trackInfos.ForEach(trackInfo => trackInfo.SegmentTrackInfos.ForEach(segmentTrackInfo => { var trackInfoView = new TrackInfoView() { FileId = trackInfo.FileId, FileName = trackInfo.FileName, FileType = trackInfo.FileType, Language = trackInfo.Language, FileProductivityScore = trackInfo.ProductivityScore, SegmentId = segmentTrackInfo.SegmentId, NumberOfKeys = segmentTrackInfo.NumberOfKeys, Text = segmentTrackInfo.Text, Translated =segmentTrackInfo.Translated, SegmentProductivityScore = segmentTrackInfo.ProductivityScore, UtcDateTime = segmentTrackInfo.UtcDateTime }; trackInfoViews.Add(trackInfoView); })); return trackInfoViews; }