here I am again.. I am trying to assign roles to the users which are registerd but whenever i try to update user details like assigning role i am getting role list required error. I try to debug the code but i didn't work. Need help from seniors!
Application user class which is inherited from identity user:
Your validation error message has already explained the problem. When you submit the form, you only fill in the three fields of Name
, Email
and RoleId
, but the Role
and RoleList
are not filled. Make these two fields nullable if you don't intend to populate them when the form is submitted:
[NotMapped]
public string? Role { get; set; }
[NotMapped]
public IEnumerable<SelectListItem>? RoleList { get; set; }