有沒有辦法對EntityFramework.Core廣東話禁用延遲加載和代理創建上的DbContext EFCore
禁用延遲加載在我以前的代碼,我也做了以下內容:
public DataContext(string nameOrConnectionString) : base(nameOrConnectionString)
{
Configuration.LazyLoadingEnabled = false;
Configuration.ProxyCreationEnabled = false;
}
,但現在使用新的EF 7我無法找到關於「加載相關數據」任何選擇這樣做
public DataContext(DbContextOptions<DataContext> options) : base(options)
{
//should have been in the options
}
基於一些研究,它看起來像沒有延遲加載的EF 7 –
是的,這對我來說很不舒服 –