Public class News
{
Public int ID {get; set; }
Public string Title {get; set; }
Public ListRoleList {get; set; }
}
Public class roles
{
Public int ID {get; set; }
Public string Title {get; set; }
Public ListThe UserList {get; set; }
Public ListNewsList {get; set; }
}
Public class User
{
Public int ID {get; set; }
Public string Name {get; set; }
Public ListRoleList {get; set; }
}
without using the core ThenInclude
Is currently the only access to the inside of the news Role but want to get the User won't find it
Using (DataContext DataContext=new DataContext ()) {
ListNews=dataContext. News. AsNbTracking (). The Include (d=& gt; D.R oleList). ToList ()
}
I also need the inside of the Role the User set could you tell me how to write should need
CodePudding user response:
For exampleMainly is to set up ForeignKey
public partial class WD_MyProject
{
[Key]
Public int id {get; set; }
Public int uid {get; set; }
[ForeignKey (" uid ")]
Public virtual WD_Employee WD_Employee {get; set; }
}