If you received a standard IdentityUser , you can do it like this:
// Create manager var manager = new UserManager<ApplicationUser>( new UserStore<ApplicationUser>( new ApplicationDbContext())) // Find user var user = manager.FindById(User.Identity.GetUserId()); var accountId = user.AccountId;
Here, I assume that you used the name ApplicationUser ;
So, suppose your class looks like this:
public class ApplicationUser : IdentityUser { public int AccountId{ get; set; } public int ClientId{ get; set; }
source share