Exemplo n.º 1
0
        public static Feedback FeedbackDtoToFeedback(FeedbackDTO dto)
        {
            Feedback feedback = new Feedback();

            feedback.Id            = dto.Id;
            feedback.User.UserName = dto.UserName;
            feedback.Comment       = dto.Comment;
            feedback.Anonymous     = dto.Anonymous;
            feedback.Public        = dto.Public;
            feedback.Published     = dto.Published;

            return(feedback);
        }
Exemplo n.º 2
0
        public static FeedbackDTO FeedbackToFeedbackDto(Feedback feedback)
        {
            FeedbackDTO dto = new FeedbackDTO
            {
                Id        = feedback.Id,
                UserName  = feedback.Anonymous ? "Anonymous" : feedback.User.UserName,
                Comment   = feedback.Comment,
                Anonymous = feedback.Anonymous,
                Public    = feedback.Public,
                Published = feedback.Published
            };

            return(dto);
        }