public FanficBuilderController(ApplicationContext context) { FanficRepository = new FanficRepository(context); TopicRepository = new TopicRepository(context); FanficTagRepository = new FanficTagRepository(context); TagRepository = new TagRepository(context); ApplicationUserRepository = new ApplicationUserRepository(context); }
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); }
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(); }
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; }
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)); }
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)); }
public TopicController(ApplicationContext context) { TopicRepository = new TopicRepository(context); RatingRepository = new RatingRepository(context); FanficRepository = new FanficRepository(context); }
public FanficController(ApplicationContext context) { FanficRepository = new FanficRepository(context); TagRepository = new TagRepository(context); TopicRepository = new TopicRepository(context); }
public ProfileController(ApplicationContext context) { ApplicationUserRepository = new ApplicationUserRepository(context); FanficRepository = new FanficRepository(context); TagRepository = new TagRepository(context); }
private List <CommentaryDTO> GetComments() { FanficRepository repo = new FanficRepository(); return(repo.GetFanficComments(Id).ToModel().ToList()); }
private List <ChapterDTO> GetChapters() { FanficRepository repo = new FanficRepository(); return(repo.GetFanficChapters(Id).ToModel().ToList()); }
private List <RatingDTO> GetRatings() { FanficRepository repo = new FanficRepository(); return(repo.GetFanficRatings(Id).ToModel().ToList()); }
private List <Tag> GetTags() { FanficRepository repo = new FanficRepository(); return(repo.GetFanficTags(Id).ToList()); }