Beispiel #1
0
 public FanficBuilderController(ApplicationContext context)
 {
     FanficRepository          = new FanficRepository(context);
     TopicRepository           = new TopicRepository(context);
     FanficTagRepository       = new FanficTagRepository(context);
     TagRepository             = new TagRepository(context);
     ApplicationUserRepository = new ApplicationUserRepository(context);
 }
Beispiel #2
0
        private void SearchInFanfics(string value, List <TagViewModel> tags)
        {
            List <FanficPreViewModel> resultList = Mapper.Map <List <FanficPreViewModel> >(
                FanficRepository.SearchInFanfics(value));

            resultList.ForEach(x => x.SetTags(tags));
            _resultFanfics.AddRange(resultList);
        }
Beispiel #3
0
 public HomeController(ApplicationContext context)
 {
     FanficRepository   = new FanficRepository(context);
     CategoryRepository = new CategoryRepository(context);
     TagRepository      = new TagRepository(context);
     TopicRepository    = new TopicRepository(context);
     CommentRepository  = new CommentRepository(context);
     _homeModel         = new HomeViewModel(Mapper.Map <List <CategoryViewModel> >(CategoryRepository.GetList()));
     _fanficComparer    = new FanficComparer();
 }
Beispiel #4
0
 public RoleController(RoleManager <IdentityRole> roleManager, UserManager <ApplicationUser> userManager, ApplicationContext context)
 {
     FanficRepository          = new FanficRepository(context);
     CommentRepository         = new CommentRepository(context);
     RatingRepository          = new RatingRepository(context);
     LikeRepository            = new LikeRepository(context);
     ApplicationUserRepository = new ApplicationUserRepository(context);
     _roleManager = roleManager;
     _userManager = userManager;
 }
Beispiel #5
0
        public IActionResult Tags(string value = "")
        {
            _resultFanfics = new List <FanficPreViewModel>();
            List <TagViewModel> tags = Mapper.Map <List <TagViewModel> >(TagRepository.GetList());

            _resultFanfics = Mapper.Map <List <FanficPreViewModel> >(FanficRepository.GetItemByTags(value));
            _resultFanfics.ForEach(x => x.SetTags(tags));
            _homeModel.Fanfics = _resultFanfics.Take(SizeOfPackage).ToList();
            _homeModel.Tags    = tags.OrderByDescending(x => x.CountOfFanfic).Take(20).ToList();
            return(View("Index", _homeModel));
        }
Beispiel #6
0
        public IActionResult Index(string status = "")
        {
            _resultFanfics = new List <FanficPreViewModel>();
            List <TagViewModel> tags = Mapper.Map <List <TagViewModel> >(TagRepository.GetList());

            _resultFanfics = Mapper
                             .Map <List <FanficPreViewModel> >(FanficRepository.GetNew());
            _resultFanfics.ForEach(x => x.SetTags(tags));
            _homeModel.Fanfics = Mapper.Map <List <FanficPreViewModel> >(FanficRepository.GetAllPopular(SizeOfPackage));
            _homeModel.Fanfics.ForEach(x => x.SetTags(tags));
            _homeModel.Tags = tags.OrderByDescending(x => x.CountOfFanfic).Take(20).ToList();
            return(View(_homeModel));
        }
Beispiel #7
0
 public TopicController(ApplicationContext context)
 {
     TopicRepository  = new TopicRepository(context);
     RatingRepository = new RatingRepository(context);
     FanficRepository = new FanficRepository(context);
 }
Beispiel #8
0
 public FanficController(ApplicationContext context)
 {
     FanficRepository = new FanficRepository(context);
     TagRepository    = new TagRepository(context);
     TopicRepository  = new TopicRepository(context);
 }
Beispiel #9
0
 public ProfileController(ApplicationContext context)
 {
     ApplicationUserRepository = new ApplicationUserRepository(context);
     FanficRepository          = new FanficRepository(context);
     TagRepository             = new TagRepository(context);
 }
Beispiel #10
0
        private List <CommentaryDTO> GetComments()
        {
            FanficRepository repo = new FanficRepository();

            return(repo.GetFanficComments(Id).ToModel().ToList());
        }
Beispiel #11
0
        private List <ChapterDTO> GetChapters()
        {
            FanficRepository repo = new FanficRepository();

            return(repo.GetFanficChapters(Id).ToModel().ToList());
        }
Beispiel #12
0
        private List <RatingDTO> GetRatings()
        {
            FanficRepository repo = new FanficRepository();

            return(repo.GetFanficRatings(Id).ToModel().ToList());
        }
Beispiel #13
0
        private List <Tag> GetTags()
        {
            FanficRepository repo = new FanficRepository();

            return(repo.GetFanficTags(Id).ToList());
        }