There are two handlers, the first should accept and process the format reference
https://localhost:44306/Activity/MyActivity
and the second with the parameter
https://localhost:44306/Activity/MyActivity?PortfolioId=1
But the trouble is that everything takes the first, the second takes only
https://localhost:44306/Activity/MyActivity/{PortfolioID}
Those. after the activation parameter is a slash
[HttpGet] public IActionResult MyActivity() { List<Activity> MyAct = db.Activities.Where(x => x.UserId == int.Parse(User.FindFirstValue("Id"))).ToList(); return View(MyAct); } [HttpGet("{PortfolioId}")] public IActionResult MyActivity(int PortfolioID) { List<Activity> MyAct = db.PortfolioActivities.Include(x => x.Activity).Where(x => x.PortfolioId == PortfolioID).Select(x=>x.Activity).ToList(); //db.Activities.Where(x => x.UserId == int.Parse(User.FindFirstValue("Id"))).ToList(); return View(MyAct); }