Esempio n. 1
0
        public IActionResult Index()
        {
            var boostupJobModels        = _jobs.GetAll().Where(j => j.Status == "1");
            var boostupJobModelsOrdered = boostupJobModels.OrderByDescending(bjm => bjm.Boostup);

            var listingResult = boostupJobModelsOrdered
                                .Select(result => new HomeBoostupListingModel
            {
                JobId          = result.Id,
                JobOfferer     = result.ApplicationUser.FirstName + " " + result.ApplicationUser.LastName,
                JobTitle       = result.Title,
                Description    = result.Description,
                Price          = result.Price,
                RequiredSkills = result.RequiredSkills
            });
            var topUsers = _users.GetTopUsers();
            var model    = new HomeIndexViewModel()
            {
                BoostedJobs = listingResult,
                BCount      = EnumCount(listingResult),
                TopUsers    = topUsers
            };

            return(View(model));
        }