コード例 #1
0
        public IActionResult Trending(Category category)
        {
            var trendsByFunds    = _projectService.GetTrendsByFunds().ToList();
            var trendsByFunders  = _projectService.GetTrendsByFunders().ToList();
            var trendsByCategory = _projectService.GetTrendsByCategory(category).ToList();

            if (trendsByFunds == null)
            {
                return(null);
            }

            if (trendsByFunders == null)
            {
                return(null);
            }

            trendsByFunds.ForEach(p => p.Description =
                                      ExtraMethod.ConvertToRawHtml(p.Description));
            trendsByFunders.ForEach(p => p.Description =
                                        ExtraMethod.ConvertToRawHtml(p.Description));
            trendsByCategory.ForEach(p => p.Description =
                                         ExtraMethod.ConvertToRawHtml(p.Description));

            var TrendingsViewModel = new TrendingViewModel()
            {
                GetTrendsByFunders  = trendsByFunders,
                GetTrendsByFunds    = trendsByFunds,
                GetTrendsByCategory = trendsByCategory
            };

            return(View(TrendingsViewModel));
        }
コード例 #2
0
        public IActionResult Details(int id)
        {
            var project = _projectService.GetById(id);

            ExtraMethod.ConvertToRawHtml(project.Description);

            project.FundingPackages.ForEach(p => p.Description = ExtraMethod.ConvertToRawHtml(p.Description));

            return(View(project));
        }
コード例 #3
0
        public IEnumerable <Project> GetTrendsByFunders()
        {
            var projects = context_.Set <Project>()
                           .Include(u => u.UserBackers)
                           .OrderByDescending(p => p.FundsReceivedCounter)
                           .ToList();

            projects.ForEach(p => p.Description = ExtraMethod.ConvertToRawHtml(p.Description));

            return(projects);
        }
コード例 #4
0
        public IEnumerable <Project> GetTrendsByFunds()
        {
            var projects = context_.Set <Project>()
                           .Include(u => u.UserCreator)
                           .OrderByDescending(p => p.CurrentFund)
                           .ToList();

            projects.ForEach(p => p.Description = ExtraMethod.ConvertToRawHtml(p.Description));

            return(projects);
        }
コード例 #5
0
        public IEnumerable <Project> GetAll()
        {
            var projects = context_.Set <Project>()
                           .Include(u => u.UserCreator)
                           .Include(fd => fd.FundingPackages).ToList();


            projects.ForEach(p => p.Description = ExtraMethod.ConvertToRawHtml(p.Description));

            return(projects);
        }
コード例 #6
0
        public IEnumerable <Project> GetTrendsByCategory(Category category)
        {
            var projects = context_.Set <Project>()
                           .Include(u => u.UserBackers)
                           .Where(p => p.Category == category)
                           .OrderByDescending(p => p.CurrentFund)
                           .ToList();

            projects.ForEach(p => p.Description = ExtraMethod.ConvertToRawHtml(p.Description));

            return(projects);
        }
コード例 #7
0
 public void SetExtraMethod(ExtraMethod extra)
 {
     this.extra = extra;
 }