سلام وقت بخیر به آقای مدائنی
این تمرین درسته
public class Role : BaseEnitiy
{
[MaxLength(100)]
public string RoleName { get; set; }
#region Relations
public ICollection<UserInRoles> UserInRoles { get; set; }
#endregion
} public class UserInRoles
{
public int UserId { get; set; }
public int RoleId { get; set; }
#region Relation
[ForeignKey("UserId")]
public User User { get; set; }
[ForeignKey("RoleId")]
public Role Roles { get; set; }
#endregion
}

به نظر درست میاد