I have some tables that have a uniqueidentifier UserID that relates to aspnet_Users.UserID. When the user submits some data for those tables, since the controller method has an [Authorize] I get a User object. I can get the username with User.Identity.Name, but how do I get the UserID to be able to establish (the ownership) relationship?
- C# – How to get a user’s client IP address in ASP.NET
- R – How to handle relationships to users from other tables in ASP.Net MVC
- Asp.net-mvc – ASP.NET MVC – Set custom IIdentity or IPrincipal
- C# – How to set the Content-Type header for an HttpClient request
- Get UserId (int) in new MVC4 application
- C# – Get the current user, within an ApiController action, without passing the userID as a parameter