public ResultRowDataDTO MapToResultRowDataDTO(ResultRowEntity source, ResultRowDataDTO target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = new ResultRowDataDTO();
            }

            target.AvgLapTime     = TimeSpanConverter.Convert(source.AvgLapTime);
            target.Car            = source.Car;
            target.CarClass       = source.CarClass;
            target.CarNumber      = source.CarNumber;
            target.ClassId        = source.ClassId;
            target.CompletedLaps  = source.CompletedLaps;
            target.FastestLapTime = TimeSpanConverter.Convert(source.FastestLapTime);
            target.FastLapNr      = source.FastLapNr;
            target.FinishPosition = source.FinishPosition;
            target.Incidents      = source.Incidents;
            target.Interval       = TimeSpanConverter.Convert(source.Interval);
            target.LeadLaps       = source.LeadLaps;
            target.Member         = MapToMemberInfoDTO(source.Member);
            target.PositionChange = source.PositionChange;
            target.QualifyingTime = TimeSpanConverter.Convert(source.QualifyingTime);
            target.ResultRowId    = source.ResultRowId;
            target.ResultId       = source.ResultId;
            target.StartPosition  = source.StartPosition;
            target.Status         = source.Status;

            return(target);
        }
        public ResultRowEntity MapToResultRowEntity(ResultRowDataDTO source, ResultRowEntity target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = GetResultRowEntity(source);
            }

            target.AvgLapTime     = TimeSpanConverter.Convert(source.AvgLapTime);
            target.Car            = source.Car;
            target.CarClass       = source.CarClass;
            target.CarNumber      = source.CarNumber;
            target.ClassId        = source.ClassId;
            target.CompletedLaps  = source.CompletedLaps;
            target.FastestLapTime = TimeSpanConverter.Convert(source.FastestLapTime);
            target.FastLapNr      = source.FastLapNr;
            target.FinishPosition = source.FinishPosition;
            target.Incidents      = source.Incidents;
            target.Interval       = TimeSpanConverter.Convert(source.Interval);
            target.LeadLaps       = source.LeadLaps;
            target.Member         = GetMemberEntity(new LeagueMemberInfoDTO()
            {
                MemberId = source.MemberId
            });
            target.Team           = DefaultGet <TeamEntity>(source.TeamId);
            target.PositionChange = source.PositionChange;
            target.QualifyingTime = TimeSpanConverter.Convert(source.QualifyingTime);
            target.StartPosition  = source.StartPosition;
            target.Status         = source.Status;
            target.Result         = GetResultEntity(new ResultInfoDTO()
            {
                ResultId = source.ResultId
            });
            target.OldIRating      = source.OldIRating;
            target.NewIRating      = source.NewIRating;
            target.CompletedPct    = source.CompletedPct;
            target.OldSafetyRating = source.OldSafetyRating;
            target.NewSafetyRating = source.NewSafetyRating;
            target.OldLicenseLevel = source.OldLicenseLevel;
            target.NewLicenseLevel = source.NewLicenseLevel;
            target.OldCpi          = source.OldCpi;
            target.NewCpi          = source.NewCpi;

            return(target);
        }
        public ResultRowDataDTO MapToResultRowDataDTO(ResultRowEntity source, ResultRowDataDTO target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = new ResultRowDataDTO();
            }

            target.AvgLapTime         = TimeSpanConverter.Convert(source.AvgLapTime);
            target.Car                = source.Car;
            target.CarClass           = source.CarClass;
            target.CarNumber          = source.CarNumber;
            target.ClassId            = source.ClassId;
            target.CompletedLaps      = source.CompletedLaps;
            target.FastestLapTime     = TimeSpanConverter.Convert(source.FastestLapTime);
            target.FastLapNr          = source.FastLapNr;
            target.FinishPosition     = source.FinishPosition;
            target.Incidents          = source.Incidents;
            target.Interval           = TimeSpanConverter.Convert(source.Interval);
            target.LeadLaps           = source.LeadLaps;
            target.MemberId           = source.MemberId; // MapToMemberInfoDTO(source.Member);
            target.PositionChange     = source.PositionChange;
            target.QualifyingTime     = TimeSpanConverter.Convert(source.QualifyingTime);
            target.ResultRowId        = source.ResultRowId;
            target.ResultId           = source.ResultId;
            target.StartPosition      = source.StartPosition;
            target.Status             = source.Status;
            target.TeamId             = source.Team?.TeamId;
            target.TeamName           = source.Team?.Name;
            target.LocationId         = source.Result.Session.LocationId;
            target.Date               = source.Date.GetValueOrDefault();
            target.OldIRating         = source.OldIRating;
            target.NewIRating         = source.NewIRating;
            target.SeasonStartIRating = source.SeasonStartIRating;
            target.CompletedPct       = source.CompletedPct;
            target.OldSafetyRating    = source.OldSafetyRating;
            target.NewSafetyRating    = source.NewSafetyRating;
            target.OldCpi             = source.OldCpi;
            target.NewCpi             = source.NewCpi;
            target.OldLicenseLevel    = source.OldLicenseLevel;
            target.NewLicenseLevel    = source.NewLicenseLevel;

            return(target);
        }