public async Task <IActionResult> Index( [FromServices] DataContext dataContext, [FromServices] IContentfulService contentfulService) { SimpleNotifier noty = notifier(); noty.AddMessage(MsgTypes.Information, "TIP: Try changing Map Layers (top right)"); IQueryable <Need> allNeedsPosts = dataContext.Needs.Include(n => n.NeedPpeTypes); //This logic is intentionally "fluffy", we are (justifiably) bumping up the Met and Partially Met percentages //by excluding posts from the "total" which volunteers cannot possibly meet: see notes on IsNotMarkedAllNotMetAndIsContactable etc int countAllNeedsPosts = allNeedsPosts.Count(); int countSeeminglyContactableNeedsPosts = allNeedsPosts.ToList().Count(n => n.IsNotMarkedAllNotMetAndIsContactable()); IQueryable <Need> fullyMetNeeds = allNeedsPosts.Where(p => p.NeedPpeTypes.All(pt => pt.StatusId == (int)PpeStatus.Met)); int countFullyMetNeeds = fullyMetNeeds.Count(); int countPartiallyMetNeeds = allNeedsPosts.Except(fullyMetNeeds).Count(p => p.NeedPpeTypes.Any(pt => pt.StatusId == (int)PpeStatus.Met)); ViewData["met"] = countFullyMetNeeds; ViewData["partial"] = countPartiallyMetNeeds; ViewData["new"] = countSeeminglyContactableNeedsPosts - (countFullyMetNeeds + countPartiallyMetNeeds); ViewData["contactable"] = countSeeminglyContactableNeedsPosts; ViewData["noncontactable"] = countAllNeedsPosts - countSeeminglyContactableNeedsPosts; ViewData["contentful"] = await contentfulService.GetFirstByContentType <HomePageViewModel>("home-page"); return(View()); }
public EbayClient(IOptions <EbayConfig> ebayConfig, IContentfulService contentfulService, ICacheService cacheService, IBaseClient baseClient) : base(baseClient) { _ebayConfig = ebayConfig.Value; _contentfulService = contentfulService; _cacheService = cacheService; _baseClient = baseClient; }
public ProductsController( ICacheService cacheService, IEmailService emailService, IEtsyClient etsyClient, IEbayClient ebayClient, IOptions <EbayConfig> ebayConfig, IInstagramClient instagramClient, IContentfulService contentfulService) : base(contentfulService) { _cacheService = cacheService; _emailService = emailService; _etsyClient = etsyClient; _ebayClient = ebayClient; _ebayConfig = ebayConfig.Value; _instagramClient = instagramClient; }
public BaseController(IContentfulService contentfulService) { _contentfulService = contentfulService; }
public ErrorController(IContentfulService contentfulService) : base(contentfulService) { }
public ContactController(IEmailService emailService, IContentfulService contentfulService) : base(contentfulService) { _emailService = emailService; }
public async Task <IActionResult> Partners([FromServices] IContentfulService contentfulService) { ViewData["contentful"] = await contentfulService.GetFirstByContentType <PartnersPageViewModel>("partners-page"); return(View()); }
public async Task <IActionResult> About([FromServices] IContentfulService contentfulService) { ViewData["contentful"] = await contentfulService.GetFirstByContentType <AboutUsPageViewModel>("about-us-page"); return(View()); }
public DynamicController(IContentfulService contentfulService) : base(contentfulService) { }
public InstagramController(IOptions <InstagramConfig> instagramConfig, IInstagramClient client, IContentfulService contentfulService) : base(contentfulService) { _instagramConfig = instagramConfig.Value; _client = client; }