public RaceSessionEntity MapToRaceSessionEntity(RaceSessionDataDTO source, RaceSessionEntity target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = GetRaceSessionEntity(source);
            }

            if (!MapToRevision(source, target))
            {
                return(target);
            }

            MapToSessionBaseEntity(source, target);
            target.IrResultLink     = source.IrResultLink;
            target.IrSessionId      = source.IrSessionId;
            target.Laps             = source.Laps;
            target.PracticeAttached = source.PracticeAttached;
            target.PracticeLength   = source.PracticeLength;
            target.QualyAttached    = source.QualyAttached;
            target.QualyLength      = source.QualyLength;
            //target.RaceId = source.RaceId;
            target.RaceLength = source.RaceLength;

            return(target);
        }
        public RaceSessionEntity GetRaceSessionEntity(RaceSessionDataDTO source)
        {
            //if (source == null)
            //    return null;
            //RaceSessionEntity target;

            //if (source.SessionId == null)
            //    target = new RaceSessionEntity();
            //else
            //    target = DbContext.Set<RaceSessionEntity>().Find(source.SessionId);

            //if (target == null)
            //    throw new EntityNotFoundException(nameof(RaceSessionEntity), "Could not find Entity in Database.", source.SessionId);

            //return target;
            return(DefaultGet <RaceSessionDataDTO, RaceSessionEntity>(source));
        }
        public RaceSessionDataDTO MapToRaceSessionDataDTO(RaceSessionEntity source, RaceSessionDataDTO target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = new RaceSessionDataDTO();
            }

            MapToSessionDataDTO(source, target);
            target.IrResultLink     = source.IrResultLink;
            target.IrSessionId      = source.IrSessionId;
            target.Laps             = source.Laps;
            target.PracticeAttached = source.PracticeAttached;
            target.PracticeLength   = source.PracticeLength;
            target.QualyAttached    = source.QualyAttached;
            target.QualyLength      = source.QualyLength;
            //target.RaceId = source.RaceId;
            target.RaceLength = source.RaceLength;

            return(target);
        }