Here is the setup
I have a product table
public partial class Product
{
public uint Id {get; set;}
public uint TypeId {get; set;}
public virtual ProductType ProductTypeNavigation { get; set; } = null!;
}
public partial class ProductType
{
public uint Id {get; set;}
public string? Caption { get; set; }
}
context for _db
public virtual DbSet<Product> Products { get; set; } = null!;
linq query
Product product = _db.Products.FirstOrDefault(x=>x.Id = 1);
What do I need to do in order for ProductTypeNavigation to be populated? It always returns null. I can see product.TypeId is populated correctly. Tried using .first instead of firstordefault still null. Tried .Where().ToList().First() same result. Also tried installing lazyload proxies still null.