Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PostsService"/> class.
 /// </summary>
 /// <param name="repo">The repo.</param>
 /// <param name="commentsService">The comments service.</param>
 /// <param name="postsTagsRelationsService">The tags service.</param>
 /// <param name="mapper">The mapper.</param>
 public PostsService(
     IRepository <Post> repo,
     ICommentsService commentsService,
     IMapper mapper,
     IPostsTagsRelationsService postsTagsRelationsService)
     : base(repo)
 {
     this.commentsService           = commentsService;
     this.postsTagsRelationsService = postsTagsRelationsService;
     this.mapper = mapper;
 }
Exemple #2
0
        // private readonly ICommentService _commentsService;

        /// <summary>
        /// Initializes a new instance of the <see cref="PostsController"/> class.
        /// </summary>
        /// <param name="controllerContext">The controller context.</param>
        /// <param name="postsService">The posts service.</param>
        /// <param name="postsTagsRelationsService">The posts tags relations service.</param>
        /// <param name="mapper">The mapper.</param>
        public PostsController(
            IControllerContext controllerContext,
            IPostsService postsService,
            IPostsTagsRelationsService postsTagsRelationsService,

            // ICommentService commentService,
            IMapper mapper) : base(controllerContext)
        {
            _postsService = postsService;
            _postsTagsRelationsService = postsTagsRelationsService;

            // _commentsService = commentService;
            _mapper = mapper;
        }