示例#1
0
 /// <summary>
 /// Constructor that accepts dependencies.
 /// </summary>
 public BlogController(
     IBlogPostRepository blogPostRepository,
     IPostCommentRepository postCommentRepository,
     IUserRepository userRepository,
     IVariableRepository variableRepository)
 {
     this._blogPostRepository = blogPostRepository;
     this._postCommentRepository = postCommentRepository;
     this._userRepository = userRepository;
     this._variableRepository = variableRepository;
     this._blogPostsPerPage = Convert.ToInt32(ConfigurationManager.AppSettings["BlogPostsPerPage"]);
 }
示例#2
0
 public HomeController(IGridUpdateRepository gridUpdateRepository,
                       IPostRepository postRepository,
                       IPostLikeRepository postLikeRepository,
                       IPostCommentRepository postCommentRepository,
                       IUnitOfWork unitOfWork)
 {
     _gridUpdateRepository  = gridUpdateRepository;
     _postRepository        = postRepository;
     _postLikeRepository    = postLikeRepository;
     _postCommentRepository = postCommentRepository;
     _unitOfWork            = unitOfWork;
 }
示例#3
0
        private static string CreatePostComment(IPostCommentRepository repository, string author, string title, Uri website, MailAddress email, string body)
        {
            var postComment = repository.Create();

            postComment.Author  = author;
            postComment.Title   = title;
            postComment.Website = website == null ? null : website.ToString();
            postComment.Body    = body;
            postComment.Email   = email == null ? null : email.Address;

            repository.Save(postComment);

            repository.SubmitChanges();

            return(postComment.ID);
        }
示例#4
0
 public PostCommentMessageProcessor(IPostCommentRepository postCommentRepository, IPostRepository postRepository)
     : base("POSTCOMMENT")
 {
     _postCommentRepository = postCommentRepository;
     _postRepository        = postRepository;
 }
示例#5
0
 public PostCommentService(IPostCommentRepository postCommentRepository)
 {
     _postCommentRepository = postCommentRepository;
 }
示例#6
0
 public PostCommentService(IPostCommentRepository repository)
 {
     _repository = repository;
 }
示例#7
0
        protected override void OnSetUpMocks()
        {
            base.OnSetUpMocks();

            _postCommentRepositoryMock = MockRepository.StrictMock <IPostCommentRepository>();
        }
 public PostCommentController(IPostCommentRepository postCommentRepository)
 {
     _postCommentRepository = postCommentRepository;
 }
 public LatestPostCommentsController(IPostCommentRepository postCommentRepository)
 {
     _postCommentRepository = postCommentRepository;
 }