What is the syntax for including multiple navigation properties in Entity Framework? What is the syntax for including multiple navigation properties in Entity Framework? asp.net asp.net

What is the syntax for including multiple navigation properties in Entity Framework?


Use

Include("Worker").Include("StatusType")


Or if it is a subproperty of the property you are including try

.Include("Worker.StatusType")


for example we have two class :public class Address { [Required] public int ProvinceId { get; set; } [ForeignKey(nameof(ProvinceId))] public Province Province { get; set; }}public class Province { [StringLength(50)] [Required] public string Name { get; set; }} //Now if you want to include province use code below :  .Include(x => x.Address).ThenInclude(x => x.Province)