コード例 #1
0
 public BlogCommentService(IBlogCommentRepository commentDal,
                           IBlogArticleRepository blogDal)
 {
     this._commentDal = commentDal;
     this.baseDal     = commentDal;
     this._blogDal    = blogDal;
 }
コード例 #2
0
 public BlogController(IBlogService blogService, IBlogCategoryService blogCategoryService, IBlogCommentRepository blogComment, IBlogTagRepository blogTagRepository, IConfiguration configuration)
 {
     _blogService         = blogService;
     _blogCategoryService = blogCategoryService;
     _blogComment         = blogComment;
     _blogTagRepository   = blogTagRepository;
     _configuration       = configuration;
 }
コード例 #3
0
        public HttpResponseMessage SubmitComment(HttpRequestMessage request, [FromBody] BlogComment blogComment)
        {
            HttpResponseMessage response = null;

            try
            {
                blogComment.Timestamp = DateTime.Now;

                PreSubmissionCommentEventArgs preArgs = new PreSubmissionCommentEventArgs(blogComment);

                _ExtensibilityManager.InvokeCancelableModuleEvent <PreSubmissionCommentEventArgs>(
                    _ModuleEvents.PreSubmissionComment, preArgs);

                if (!preArgs.Cancel)
                {
                    IBlogCommentRepository blogCommentRepository = _componentLocator.ResolveComponent <IBlogCommentRepository>();

                    blogComment.CommentBody = preArgs.CommentReplacement;
                    blogComment             = blogCommentRepository.Add(blogComment);

                    PostSubmissionCommentEventArgs postArgs = new PostSubmissionCommentEventArgs(blogComment);

                    _ExtensibilityManager.InvokeModuleEvent <PostSubmissionCommentEventArgs>(
                        _ModuleEvents.PostSubmissionComment, postArgs);

                    response = request.CreateResponse <BlogComment>(HttpStatusCode.OK, blogComment);
                }
                else
                {
                    throw new ApplicationException("Comment submission has been blocked.");
                }
            }
            catch (Exception ex)
            {
                response = request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
            }

            return(response);
        }
コード例 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 public BlogCommentBlockController(IBlogCommentRepository commentRepository, IPageRepository pageRepository, IPageRouteHelper pageRouteHelper)
 {
     _commentRepository = commentRepository;
     _pageRepository    = pageRepository;
     _pageRouteHelper   = pageRouteHelper;
 }
コード例 #5
0
 public BlogCommentService(IBlogCommentRepository blogCommentRepository)
 {
     BlogCommentRepository = blogCommentRepository;
 }
コード例 #6
0
 public BlogCommentController(IBlogCommentRepository blogCommentRepository)
 {
     _blogCommentRepository = blogCommentRepository;
 }
コード例 #7
0
 public BlogCommandHandler(IBlogCommentRepository blogCommentRepository)
 {
     _blogCommentRepository = blogCommentRepository;
 }
コード例 #8
0
 public BlogCommentService(IBlogCommentRepository blogCommentRepository) : base(blogCommentRepository)
 {
 }
コード例 #9
0
 public BlogDomain(IBlogRepository blogRepository, IBlogCommentRepository blogCommentRepository, IImageRepository imageRepository)
 {
     _blogRepository        = blogRepository;
     _blogCommentRepository = blogCommentRepository;
     _imageRepository       = imageRepository;
 }
コード例 #10
0
 public BlogCommentService(IBlogCommentRepository blogCommentRepository, IUnitOfWork unitOfWork)
 {
     _blogCommentRepository = blogCommentRepository;
     _unitOfWork            = unitOfWork;
 }