0

I've tried googling but all the results semms to be for older versions.

I'm trying to get the logged in user's id and then compare it to another table. In (sorta) clear text i mean like this:

 If (the current logged in user's id == Goals.UserId)
 {
     show all the logged in user's goal
 }
Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
anek05
  • 19
  • 5

1 Answers1

0

If you're using Asp.Net Core Identity, you could use their extension method to simplify access to it:

using Microsoft.AspNet.Identity;
[…]

if (User.Identity.GetUserId() == Goals.UserId)
{
    // show all the logged in user's goal
}
user1672994
  • 10,509
  • 1
  • 19
  • 32
Lazy Gul
  • 16
  • 2