FreeSql
FreeSql copied to clipboard
继承模式下 IncludeMany 异常
<Table("User")>
Public Class UserEntity
Public Property ID As Long
Public Property Account As String
<Navigate(ManyToMany:=GetType(RoleUserEntity))>
Public Property Roles As IEnumerable(Of RoleEntity)
End Class
<Table("Role")>
Public Class RoleEntity
Public Property ID As Long
Public Property Name As String
<Navigate(ManyToMany:=GetType(RoleUserEntity))>
Public Property Users As IEnumerable(Of RoleEntity)
End Class
<Table("RoleUser")>
Public Class RoleUserEntity
Public Property ID As Long
Public Property RoleId As Long
Public Property Role As RoleEntity
Public Property UserId As Long
Public Property User As UserEntity
End Class
<Table("User")>
Public Class AppUserEntity
Inherits UserEntity
End Class
Db.Select(Of UserEntity).IncludeMany(Function(x) x.Roles).ToList() 执行正常
Db.Select(Of AppUserEntity).IncludeMany(Function(x) x.Roles).ToList() 执行异常
导航属性,暂时不支持继承