public PostController()
 {
     _postRepository     = new PostRepository(Context);
     _tagRepository      = new TagRepository(Context);
     _categoryRepository = new PostCategoryRepository(Context);
     _postTagsRepository = new PostTagsRepository(Context);
 }
Exemple #2
0
        public PostCategoryController(CarSellerContext context, IMapper mapper)
        {
            var repository = new PostCategoryRepository(context);
            var uow        = new UnitOfWork(context);

            _testMapper          = mapper;
            _postCategoryService = new PostCategoryViewModelService(repository, uow, mapper);
        }
Exemple #3
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context         = context;
     Posts            = new PostRepository(context);
     Categories       = new PostCategoryRepository(context);
     ApplicationUsers = new UserRepository(context);
     Pages            = new PageRepository(context);
     Menus            = new MenuRepository(context);
 }
Exemple #4
0
        /// <summary>
        ///  Initializes the view model.
        /// </summary>

        public virtual void Init(TagRepository tagRepository, PostCategoryRepository categoryRepository)
        {
            TagSelectListItems = new SelectList(
                tagRepository.GetList(includeRelatedEntities: false),
                "Id", "Name");


            CategorySelectListItems = new SelectList(
                categoryRepository.GetList(includeRelatedEntities: false),
                "Id", "Name");
        }
Exemple #5
0
        public UnitOfWork(
            ApplicationDbContext context,
            UserManager <User> userManager,
            SignInManager <User> signInManager,
            IPasswordHasher <User> passwordHasher
            )
        {
            _context = context;

            CertificateRepository  = new CertificateRepository(_context);
            ContactRepository      = new ContactRepository(_context);
            PostCategoryRepository = new PostCategoryRepository(_context);
            PostCommentRepository  = new PostCommentRepository(_context);
            PostRepository         = new PostRepository(_context);
            ProgressBarRepository  = new ProgressBarRepository(_context);
            SettingRepository      = new SettingRepository(_context);
            UserRepository         = new UserRepository(userManager, signInManager, passwordHasher);
        }
Exemple #6
0
 public PostCategoryService(PostCategoryRepository postCategoryRepository, IUnitOfWork unitOfWork)
 {
     this._postCategoryRepository = postCategoryRepository;
     this._unitOfWork             = unitOfWork;
 }
 public override void Init(TagRepository tagRepository, PostCategoryRepository categoryRepository)
 {
     base.Init(tagRepository, categoryRepository);
 }
Exemple #8
0
 public WidgetViewModel(PostRepository postRepository, PostCategoryRepository categoryRepository, TagRepository tagRepository)
 {
     PostCategories = categoryRepository.GetList();
     Tags           = tagRepository.GetList();
     LatestPosts    = postRepository.Posts(0, 10);
 }
 public PostCategoryController()
 {
     _categoryRepository = new PostCategoryRepository(Context);
 }
 public PostCategoryViewModelService(PostCategoryRepository postcategoryRepository, UnitOfWork uow, IMapper mapper) : base(uow, postcategoryRepository, mapper)
 {
 }