示例#1
0
        public void AddComment(CommentDto comment, int itemId, CommentStatus status)
        {
            Item item = this.Session.Load <Item>(itemId);

            if (item == null)
            {
                throw new DexterItemNotFoundException(itemId);
            }

            ItemComments itemComments = this.Session.Load <ItemComments>(itemId)
                                        ?? new ItemComments();

            Comment domainComment = comment.MapTo <Comment>();

            itemComments.AddComment(domainComment, status);

            this.Session.Store(itemComments);
        }