Exemplo n.º 1
0
        private ICollection<Domain.Model.LessonComment> GetLessonComments(Lesson lesson)
        {
            ICollection<Domain.Model.LessonComment> DomainComments = new List<Domain.Model.LessonComment>();
            var lessonComments = (from c in _db.LessonComments
                                 where c.LessonId.Equals(lesson.LessonId)
                                 select c).ToList();

            foreach (var comment in lessonComments)
            {
                DomainComments.Add(new Domain.Model.LessonComment()
                {
                    Id = _db.IdMaps.GetAggregateId<LessonComment>(comment.Id),
                    AuthorId = _db.IdMaps.GetAggregateId<User>(comment.UserId),
                    Content = comment.Content,
                    CreationDate = comment.CreationDate,
                    Date = comment.Date,
                    //LessonId = _db.IdMaps.GetAggregateId<User>(comment.UserId),
                    Level = comment.Level,
                    ParentId = comment.ParentId == null ? null : (Guid?)_db.IdMaps.GetAggregateId<LessonComment>(comment.ParentId.Value),
                    RecordState = comment.RecordState,
                    Vers = comment.Vers
                }
                );
            }
            return DomainComments;
        }
Exemplo n.º 2
0
        private ICollection<Domain.Model.LessonRating> GetLessonRatings(Lesson lesson)
        {
            ICollection<Domain.Model.LessonRating> DomainRatings = new List<Domain.Model.LessonRating>();
            var lessonRatings = from c in _db.LessonRatings
                                where c.LessonId.Equals(lesson.LessonId)
                                select c;

            foreach (var rating in lessonRatings)
            {
                DomainRatings.Add(new Domain.Model.LessonRating()
                {
                    Id = _db.IdMaps.GetAggregateId<LessonRating>(rating.Id),
                    UserId = _db.IdMaps.GetAggregateId<User>(rating.UserId),
                    Content = rating.Content,
                    CreationDate = rating.CreationDate,
                    LastModifDate = rating.LastModifDate,
                    LastModifUser = rating.LastModifUser,
                    Rating = rating.Rating,
                    RecordState = rating.RecordState,
                    Vers = rating.Vers
                }
                );
            }
            return DomainRatings;
        }
Exemplo n.º 3
0
 private ICollection<Domain.Model.LessonTag> GetLessonTags(Lesson lesson)
 {
     ICollection<Domain.Model.LessonTag> DomainTags = new List<Domain.Model.LessonTag>();
     foreach (var tag in lesson.Tags)
     {
         DomainTags.Add(new Domain.Model.LessonTag()
         {
             LessonTagName = tag.LessonTagName
         }
         );
     }
     return DomainTags;
 }
Exemplo n.º 4
0
 private ICollection<Domain.Model.LessonFeedback> GetLessonFeedbacks(Lesson lesson)
 {
     ICollection<Domain.Model.LessonFeedback> DomainFeedbacks = new List<Domain.Model.LessonFeedback>();
     foreach (var feedback in lesson.FeedBacks)
     {
         DomainFeedbacks.Add(new Domain.Model.LessonFeedback()
         {
             Id = _db.IdMaps.GetAggregateId<LessonFeedback>(feedback.LessonFeedbackId),
             Feedback = feedback.Feedback,
             Nature = feedback.Nature
         }
         );
     }
     return DomainFeedbacks;
 }