I'm using Identity with aspnet core 2.0 and I needed to add the nuCPF attribute in the ApplicationUser table. In the controller I am getting the user data as follows:
[Controller: ClientController )
public ClienteController(UserManager<ApplicationUser> userManager)
{
_userManager = userManager;
}
[HttpGet]
public ActionResult Index(int paginaAtual = 1, string filtro = "")
{
var NomeUsuarioLogado = User.Identity.Name;
var idUsuarioLogado = _userManager.GetUserId(HttpContext.User);
xxxxx.... etc
}
The ApplicationUser class looks like this:
public class ApplicationUser
{
public int Id { get; set; }
public string UserName { get; set; }
public string NormalizedUserName { get; set; }
public string Email { get; set; }
public string NormalizedEmail { get; set; }
public bool EmailConfirmed { get; set; }
public string PasswordHash { get; set; }
public string PhoneNumber { get; set; }
public bool PhoneNumberConfirmed { get; set; }
public bool TwoFactorEnabled { get; set; }
public string nuCPF { get; set; }
}
Doubt 1:
How can I get the value of the nuCPF field?