public void AddComment(Comment comment)
        {
            ValidateComment(comment, CommentProperties.All);
            var commentModel = new DB.Comment()
            {
                Id      = comment.Id,
                Content = comment.Content,
                PostId  = comment.PostId,
            };

            var ratableEntityModel = new DB.RatableEntity()
            {
                Id          = comment.Id,
                PublishDate = comment.PublishDate,
                UserId      = comment.AuthorId
            };

            using (var ctx = new DB.CodingIdeasEntities())
            {
                ctx.RatableEntities.Add(ratableEntityModel);
                ctx.Comments.Add(commentModel);
                ctx.SaveChanges();
            }
        }
        public void AddPost(Post post)
        {
            ValidatePost(post, PostProperties.All);
            var postModel = new DB.Post()
            {
                Id      = post.Id,
                Content = post.Content,
                Title   = post.Title
            };

            var ratableEntityModel = new DB.RatableEntity()
            {
                Id          = post.Id,
                UserId      = post.AuthorId,
                PublishDate = post.PublishDate
            };

            using (var ctx = new DB.CodingIdeasEntities())
            {
                ctx.RatableEntities.Add(ratableEntityModel);
                ctx.Posts.Add(postModel);
                ctx.SaveChanges();
            }
        }