Exemple #1
0
        public Review ChangeReviewStatus(Guid id, ReviewStatus status)
        {
            var review = _uow.Database.SingleById <ReviewDto>(id);

            review.Status = (int)status;

            _uow.Database.Update(review);

            return(EntityFactory.BuildEntity(review));
        }
Exemple #2
0
        public Review SaveReview(Review review)
        {
            var dto = EntityFactory.BuildDto(review);

            dto.Id = dto.Id == Guid.Empty ? Guid.NewGuid() : dto.Id;

            _uow.Database.Save(dto);

            return(EntityFactory.BuildEntity(dto));
        }
Exemple #3
0
        public Comment SaveComment(Comment comment)
        {
            var dto = EntityFactory.BuildDto(comment);

            dto.Id = dto.Id == Guid.Empty ? Guid.NewGuid() : dto.Id;

            var entry = _uow.Database.SingleOrDefaultById <CommentDto>(dto.Id);

            if (entry == null)
            {
                dto.CreateDate = dto.CreateDate == DateTime.MinValue ? DateTime.UtcNow : dto.CreateDate;
            }
            else
            {
                dto.CreateDate = entry.CreateDate;
            }

            _uow.Database.Save(dto);

            return(EntityFactory.BuildEntity(dto));
        }