public PostMessageProcessor(IPostRepository postRepository, IPostCategoryRepository postCategoryRepository, IPictureRepository pictureRepository) : base("POST") { _postRepository = postRepository; _postCategoryRepository = postCategoryRepository; _pictureRepository = pictureRepository; }
[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); }
public PostService(IPostRepository postRepository, IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork) { this._postCategoryRepository = postCategoryRepository; this._postRepository = postRepository; this._unitofwork = unitOfWork; }
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); }
public PostService(IPostRepository postRepository, IUnitOfWork unitOfWork, ITagRepository tagRepository, IPostTagRepository postTagRepository, IPostCategoryRepository postCategoryRepository) { _postRepository = postRepository; _postCategoryRepository = postCategoryRepository; _unitOfWork = unitOfWork; _tagRepository = tagRepository; _postTagRepository = postTagRepository; }
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); }
public void Initialize() { dbFactory = new DbFactory(); //Truyền vào DBfactory objRepository = new PostCategoryRepository(dbFactory); unitOfWork = new UnitOfWork(dbFactory); }
public PostCategoryService( IMapper autoMapperService, IValidator <CreateCategoryRequestBo> createCategoryValidator, IPostCategoryRepository postCategoryRepository) { this._autoMapperService = autoMapperService; this._createCategoryValidator = createCategoryValidator; this._postCategoryRepository = postCategoryRepository; }
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; }
public PostCategoryService(IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork) { _postCategoryRepository = postCategoryRepository; _unitOfWork = unitOfWork; }
public void Initialize() { _dbFactory = new DbFactory(); _postCategoryRepository = new PostCategoryRepository(_dbFactory); _unitOfWork = new UnitOfWork(_dbFactory); }
public PostController(IPostRepository postRepository, IPostCategoryRepository postCategoryRepository, ITagRepository tagRepository) { _postRepository = postRepository; _postCategoryRepository = postCategoryRepository; _tagRepository = tagRepository; }
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); }
public PostCategoryService(IPostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork) { this._postCategoryRepository = postCategoryRepository; this._unitOfWork = unitOfWork; }
public PostCategoryService(IPostCategoryRepository postCategoryRepository) { _postCategoryRepository = postCategoryRepository; }
public void Initialize() { DbFactory = new DbFactory(); objRepository = new PostCategoryRepository(DbFactory); unitOfWork = new UnitOfWork(DbFactory); }
public PostCategoryService(IPostCategoryRepository repository, IUnitOfWork unitOfWork) { this._repository = repository; this._unitOfWork = unitOfWork; }
public HomeController(IPostCategoryRepository postCategoryRepository) { _postCategoryRepository = postCategoryRepository; }
public PostCategoryService(IPostCategoryRepository postCategoryRepository, IPostCategoryMapper postCategoryMapper) { this.postCategoryRepository = postCategoryRepository; this.postCategoryMapper = postCategoryMapper; }
public PostCategoryService(IPostCategoryRepository postCategoryService, IUnitOfWork unitOfWork) { this._postCategoryRepository = postCategoryService; this._unitOfWork = unitOfWork; }
public PostCategoryService(IPostCategoryRepository PostCategory, IUnitOfWork iU) { _postCategoryReponsitory = PostCategory; _unitOfWork = iU; }
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; }
public void Initialize() { dbFactory = new DbFactory(); iPostCategoryRepository = new PostCategoryRepository(dbFactory); iUnitOfWork = new UnitOfWork(dbFactory); }