public PostMessageProcessor(IPostRepository postRepository, IPostCategoryRepository postCategoryRepository, IPictureRepository pictureRepository)
     : base("POST")
 {
     _postRepository         = postRepository;
     _postCategoryRepository = postCategoryRepository;
     _pictureRepository      = pictureRepository;
 }
示例#2
0
 [TestInitialize] // Thuộc tính chạy lần đầu tien khi ứng dụng chạy
 public void Initialize()
 {
     // Khai báo dùng inteface, khởi tạo dùng contractor
     dbFactory     = new DbFactory();
     objRepository = new PostCategoryRepository(dbFactory);
     unitOfWork    = new UnitOfWork(dbFactory);
 }
示例#3
0
 public PostService(IPostRepository postRepository,
                    IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork)
 {
     this._postCategoryRepository = postCategoryRepository;
     this._postRepository         = postRepository;
     this._unitofwork             = unitOfWork;
 }
示例#4
0
        protected override void OnSetUpMocks()
        {
            base.OnSetUpMocks();

            _postRepositoryMock         = MockRepository.StrictMock <IPostRepository>();
            _postCategoryRepositoryMock = MockRepository.StrictMock <IPostCategoryRepository>();
        }
 ///Phuong thuc dau tien khoi tao cac tham so doi tuong
 public void Initialize()
 {
     //khoi tao doi tuong
     dbFactory     = new DbFactory();
     objRepository = new PostCategoryRepository(dbFactory);
     unitOfWork    = new UnitOfWork(dbFactory);
 }
 public void Initialize()
 {
     dbFactory     = new DbFactory();
     objRepository = new PostCategoryRepository(dbFactory);
     //Dùng commit
     unitOfWork = new UnitOfWork(dbFactory);
 }
示例#7
0
 public PostService(IPostRepository postRepository, IUnitOfWork unitOfWork, ITagRepository tagRepository, IPostTagRepository postTagRepository, IPostCategoryRepository postCategoryRepository)
 {
     _postRepository         = postRepository;
     _postCategoryRepository = postCategoryRepository;
     _unitOfWork             = unitOfWork;
     _tagRepository          = tagRepository;
     _postTagRepository      = postTagRepository;
 }
示例#8
0
 public UnitOfWork(IDesignTimeDbContextFactory <DatabaseContext> databaseContext)
 {
     _context       = databaseContext.CreateDbContext(args: null);
     Posts          = new PostRepository(_context);
     Categories     = new CategoryRepository(_context);
     Accounts       = new AccountRepository(_context);
     PostCategories = new PostCategoryRepository(_context);
 }
示例#9
0
        public void Initialize()
        {
            dbFactory = new DbFactory();

            //Truyền vào DBfactory
            objRepository = new PostCategoryRepository(dbFactory);
            unitOfWork    = new UnitOfWork(dbFactory);
        }
示例#10
0
 public PostCategoryService(
     IMapper autoMapperService,
     IValidator <CreateCategoryRequestBo> createCategoryValidator,
     IPostCategoryRepository postCategoryRepository)
 {
     this._autoMapperService       = autoMapperService;
     this._createCategoryValidator = createCategoryValidator;
     this._postCategoryRepository  = postCategoryRepository;
 }
示例#11
0
        private static string CreatePostCategory(IPostCategoryRepository repository, string title, string body)
        {
            var postCategory = repository.Create();

            postCategory.Title = title;
            postCategory.Body  = body;

            repository.Save(postCategory);

            repository.SubmitChanges();

            return(postCategory.ID);
        }
 public HomeController(IPostRepository _postrepository,
                       IHeaderRepository _headerrepository,
                       IPostCategoryRepository _postcategoryrepository,
                       ICategoryRepository _categoryrepository,
                       IMessageRepository _messagerepository,
                       ICommentRepository _commentRepository,
                       ILoginInfoRepository _logininforepository)
 {
     this._postrepository         = _postrepository;
     this._categoryrepository     = _categoryrepository;
     this._headerrepository       = _headerrepository;
     this._messagerepository      = _messagerepository;
     this._postcategoryrepository = _postcategoryrepository;
     this._commentRepository      = _commentRepository;
     this._logininforepository    = _logininforepository;
 }
示例#13
0
 public PostCategoryService(IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork)
 {
     _postCategoryRepository = postCategoryRepository;
     _unitOfWork             = unitOfWork;
 }
 public void Initialize()
 {
     _dbFactory = new DbFactory();
     _postCategoryRepository = new PostCategoryRepository(_dbFactory);
     _unitOfWork             = new UnitOfWork(_dbFactory);
 }
示例#15
0
 public PostController(IPostRepository postRepository, IPostCategoryRepository postCategoryRepository, ITagRepository tagRepository)
 {
     _postRepository         = postRepository;
     _postCategoryRepository = postCategoryRepository;
     _tagRepository          = tagRepository;
 }
示例#16
0
 public PostCategoryService(IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork)
 {
     this.postCategoryRepository = postCategoryRepository;
     this.unitOfWork             = unitOfWork;
 }
 public void Init()
 {
     dbFactory      = new DbFactory();
     unitOfWork     = new UnitOfWork(dbFactory);
     objPostCateRep = new PostCategoryRepository(dbFactory);
 }
示例#18
0
 public PostCategoryService(IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork)
 {
     this._postCategoryRepository = postCategoryRepository;
     this._unitOfWork = unitOfWork;
 }
示例#19
0
 public PostCategoryService(IPostCategoryRepository postCategoryRepository)
 {
     _postCategoryRepository = postCategoryRepository;
 }
示例#20
0
 public void Initialize()
 {
     DbFactory     = new DbFactory();
     objRepository = new PostCategoryRepository(DbFactory);
     unitOfWork    = new UnitOfWork(DbFactory);
 }
示例#21
0
 public PostCategoryService(IPostCategoryRepository repository, IUnitOfWork unitOfWork)
 {
     this._repository = repository;
     this._unitOfWork = unitOfWork;
 }
示例#22
0
 public HomeController(IPostCategoryRepository postCategoryRepository)
 {
     _postCategoryRepository = postCategoryRepository;
 }
 public PostCategoryService(IPostCategoryRepository postCategoryRepository, IPostCategoryMapper postCategoryMapper)
 {
     this.postCategoryRepository = postCategoryRepository;
     this.postCategoryMapper     = postCategoryMapper;
 }
示例#24
0
 public PostCategoryService(IPostCategoryRepository postCategoryService, IUnitOfWork unitOfWork)
 {
     this._postCategoryRepository = postCategoryService;
     this._unitOfWork             = unitOfWork;
 }
 public PostCategoryService(IPostCategoryRepository PostCategory, IUnitOfWork iU)
 {
     _postCategoryReponsitory = PostCategory;
     _unitOfWork = iU;
 }
示例#26
0
 public PostCategoryController(IPostCategoryRepository categoryRepository, IPostRepository postRepository)
 {
     _categoryRepository = categoryRepository;
     _postRepository     = postRepository;
 }
 public PostCategoriesController(IPostCategoryRepository postCategoryRepository)
 {
     _postCategoryRepository = postCategoryRepository;
 }
 public PostCategoryService(IPostCategoryRepository postCategoryRepository, UserManager <User> userManager, IHttpContextAccessor httpContext)
 {
     _postCategoryRepository = postCategoryRepository;
     _userManager            = userManager;
     _httpContext            = httpContext;
 }
示例#29
0
 public void Initialize()
 {
     dbFactory = new DbFactory();
     iPostCategoryRepository = new PostCategoryRepository(dbFactory);
     iUnitOfWork             = new UnitOfWork(dbFactory);
 }