public static UserChallengeDTO MapToUserChallengeDTO(ChallengeUser challengeUser) { return(challengeUser == null || challengeUser.User == null || challengeUser.Challenge == null ? null: new UserChallengeDTO { UserId = challengeUser.UserId, UserFirstName = challengeUser.User.FirstName, UserFamilyName = challengeUser.User.FamilyName, CompletedDate = challengeUser.CompletedDate, Challenge = challengeUser.Challenge, Rating = challengeUser.Rating, Feedback = challengeUser.Feedback }); }
public static ChallengesOfUserDTO MapToChallengesOfUserDTO(ChallengeUser challengeUser) { return(challengeUser == null || challengeUser.User == null || challengeUser.Challenge == null ? null : new ChallengesOfUserDTO { ChallengeId = challengeUser.Challenge.ChallengeId, Category = challengeUser.Challenge.Category, ChallengeImage = challengeUser.Challenge.ChallengeImage, Description = challengeUser.Challenge.Description, Title = challengeUser.Challenge.Title, CompletedDate = challengeUser.CompletedDate, Rating = challengeUser.Rating, Feedback = challengeUser.Feedback }); }