私のアプリケーションでは、最初にエンティティ フレームワーク 5 コードを使用していました。"Include" を使用せずにサブ テーブル データを取得したい
public class Category
{
public int Id {get; set;}
public string Name {get; set;}
public virtual ICollection<Product> Products{get;set;}
}
public class Product
{
public int id {get;set}
public string Name{get;set;}
public virtual Category {get;set;}
}
私はそれを両方の方法で取得する必要があるので、そのための解決策があります