I have a problem I'm stuck with that I do not know how to solve. I want to be able to display items associated with my logged in user on a view. I have previously done a many to many relationship between user and ticket. Now I want to make a UserProfile where I can show which Tickets are connected to the logged in user. But there is a problem when I do not know how to get urgent information about when you are logged in. I use MVC IdentityUser and Ef Core.
I have tried something in this direction
public IActionResult MyProfile(string id)
{
var Tickets = _db.UserTickets
.Include(n => n.ApplicationUser)
.Include(n => n.Ticket)
.Where(n => n.UserId == id)
.ToList();
return View(Tickets);
}