I have correctly established the connection between the account and the Role. I define a role for the account by typing the Id of the Role. But when I try to login to the account I get this error. I could not solve the problem. The code causing the error is:
claims.Add(new Claim(ClaimTypes.Role, account.Role.Name));
The error I get is this System.NullReferenceException: 'Object reference not set to an instance of an object.'
bilgiislem.Models.Hesap.Role.get returned null.
Please help me