public SessionInfoDTO MapToSessionInfoDTO(SessionBaseEntity source, SessionInfoDTO target = null) { if (source == null) { return(null); } if (target == null) { target = new SessionInfoDTO(); } MapToVersionInfoDTO(source, target); target.SessionId = source.SessionId; target.SessionType = source.SessionType; return(target); }
public SessionBaseEntity GetSessionBaseEntity(SessionInfoDTO source) { //if (source == null) // return null; //SessionBaseEntity target; //if (source is RaceSessionDataDTO raceSession) // target = GetRaceSessionEntity(raceSession); //else if (source.SessionId == null) // target = new SessionBaseEntity(); //else // target = DbContext.Set<SessionBaseEntity>().Find(source.SessionId); //if (target == null) // throw new EntityNotFoundException(nameof(SessionBaseEntity), "Could not find Entity in Database.", source.SessionId); //return target; return(DefaultGet <SessionInfoDTO, SessionBaseEntity>(source)); }