public IActionResult Generated(HomeForum forum) { List <Link> returnLinks = new List <Link>(); List <Link> links = new List <Link>(); if (context.Links.Count() < 1) { links = LazySeed(); context.AddRange(links); context.SaveChanges(); links = new List <Link>(); } returnLinks = context.Links.Where(l => l.Catagory == forum.FinancialMental || l.SubCatagory.Contains(forum.TeenYA)).ToList(); HomepageModel model = new HomepageModel(); model.Links = returnLinks; //pass model to view return(View(model)); }